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).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GenDiskBuilder
impl RefUnwindSafe for GenDiskBuilder
impl Send for GenDiskBuilder
impl Sync for GenDiskBuilder
impl Unpin for GenDiskBuilder
impl UnwindSafe for GenDiskBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> PinInit<T> for T
impl<T> PinInit<T> for T
Source§unsafe fn __pinned_init(self, slot: *mut T) -> Result<(), Infallible>
unsafe fn __pinned_init(self, slot: *mut T) -> Result<(), Infallible>
slot
. Read more