pub struct AllocationUnit { /* private fields */ }Expand description
Net bytes per unit of whatever Status counts for a partition: 1 where the
counters are byte-granular, the net storage block in a library.
See Partition::allocation_unit, which is the only source of one.
Implementations§
Source§impl AllocationUnit
impl AllocationUnit
pub fn get(self) -> u32
Sourcepub fn is_bytes(self) -> bool
pub fn is_bytes(self) -> bool
Whether this partition’s counters are byte-granular rather than block-granular.
Sourcepub fn blocks_for(self, bytes: usize) -> Result<u32>
pub fn blocks_for(self, bytes: usize) -> Result<u32>
How many units a body of bytes occupies.
⚠️ Rounds up. Undercounting makes cmd::BEGIN_WRITE refuse 0x16 even
straight after a cleaning pass that reclaimed what the undercount asked for.
Trait Implementations§
Source§impl Clone for AllocationUnit
impl Clone for AllocationUnit
Source§fn clone(&self) -> AllocationUnit
fn clone(&self) -> AllocationUnit
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for AllocationUnit
Source§impl Debug for AllocationUnit
impl Debug for AllocationUnit
impl Eq for AllocationUnit
Source§impl PartialEq for AllocationUnit
impl PartialEq for AllocationUnit
impl StructuralPartialEq for AllocationUnit
Auto Trait Implementations§
impl Freeze for AllocationUnit
impl RefUnwindSafe for AllocationUnit
impl Send for AllocationUnit
impl Sync for AllocationUnit
impl Unpin for AllocationUnit
impl UnsafeUnpin for AllocationUnit
impl UnwindSafe for AllocationUnit
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
Mutably borrows from an owned value. Read more