pub struct GenDiskBuilder { /* private fields */ }
Expand description
Implementations§
Source§impl GenDiskBuilder
impl GenDiskBuilder
Sourcepub fn rotational(self, rotational: bool) -> Self
pub fn rotational(self, rotational: bool) -> Self
Set the rotational media attribute for the device to be built.
Sourcepub fn logical_block_size(self, block_size: u32) -> Result<Self>
pub fn logical_block_size(self, block_size: u32) -> Result<Self>
Set the logical block size of the device to be built.
This method will check that block size is a power of two and between 512 and 4096. If not, an error is returned and the block size is not set.
This is the smallest unit the storage device can address. It is typically 4096 bytes.
Sourcepub fn physical_block_size(self, block_size: u32) -> Result<Self>
pub fn physical_block_size(self, block_size: u32) -> Result<Self>
Set the physical block size of the device to be built.
This method will check that block size is a power of two and between 512 and 4096. If not, an error is returned and the block size is not set.
This is the smallest unit a physical storage device can write atomically. It is usually the same as the logical block size but may be bigger. One example is SATA drives with 4096 byte physical block size that expose a 512 byte logical block size to the operating system.
Sourcepub fn capacity_sectors(self, capacity: u64) -> Self
pub fn capacity_sectors(self, capacity: u64) -> Self
Set the capacity of the device to be built, in sectors (512 bytes).