pub enum BlockSize {
HumanBinary,
HumanSi,
Bytes(u64),
}Expand description
How to scale sizes / block counts (--block-size).
Variants§
HumanBinary
Human binary (-h): powers of 1024 with unit suffix.
HumanSi
Human SI (--si): powers of 1000.
Bytes(u64)
Fixed divisor in bytes (e.g. 1024 for 1K, 1000 for KB).
Implementations§
Source§impl BlockSize
impl BlockSize
Sourcepub fn parse(s: &str) -> Option<Self>
pub fn parse(s: &str) -> Option<Self>
Parse GNU-style SIZE: K, M, G, T, KB, MB, 1K, 1024, etc.
- Binary suffixes without
B(K/M/G/T/P/E) are powers of 1024. - SI suffixes (
KB/MB/…) are powers of 1000. - Bare number is bytes.
Sourcepub fn block_divisor(self) -> u64
pub fn block_divisor(self) -> u64
Divisor used when displaying allocated blocks (-s).
Human modes fall back to 1024 (kibibytes).
Trait Implementations§
impl Copy for BlockSize
impl Eq for BlockSize
impl StructuralPartialEq for BlockSize
Auto Trait Implementations§
impl Freeze for BlockSize
impl RefUnwindSafe for BlockSize
impl Send for BlockSize
impl Sync for BlockSize
impl Unpin for BlockSize
impl UnsafeUnpin for BlockSize
impl UnwindSafe for BlockSize
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more