Struct humansize::file_size_opts::FileSizeOpts
source · [−]pub struct FileSizeOpts {
pub divider: Kilo,
pub units: Kilo,
pub decimal_places: usize,
pub decimal_zeroes: usize,
pub fixed_at: FixedAt,
pub long_units: bool,
pub space: bool,
pub suffix: &'static str,
pub allow_negative: bool,
}Expand description
Holds the options for the file_size method.
Fields
divider: KiloThe scale (binary/decimal) to divide against.
units: KiloThe unit set to display.
decimal_places: usizeThe amount of decimal places to display if the decimal part is non-zero.
decimal_zeroes: usizeThe amount of zeroes to display if the decimal part is zero.
fixed_at: FixedAtWhether to force a certain representation and if so, which one.
long_units: boolWhether to use the full suffix or its abbreveation.
space: boolWhether to place a space between value and units.
suffix: &'static strAn optional suffix which will be appended after the unit.
allow_negative: boolWhether to allow negative numbers as input. If False, negative values will return an error.
Trait Implementations
sourceimpl AsRef<FileSizeOpts> for FileSizeOpts
impl AsRef<FileSizeOpts> for FileSizeOpts
sourcefn as_ref(&self) -> &FileSizeOpts
fn as_ref(&self) -> &FileSizeOpts
Performs the conversion.
Auto Trait Implementations
impl RefUnwindSafe for FileSizeOpts
impl Send for FileSizeOpts
impl Sync for FileSizeOpts
impl Unpin for FileSizeOpts
impl UnwindSafe for FileSizeOpts
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more