Struct humansize::file_size_opts::FileSizeOpts[][src]

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: Kilo

The scale (binary/decimal) to divide against.

units: Kilo

The unit set to display.

decimal_places: usize

The amount of decimal places to display if the decimal part is non-zero.

decimal_zeroes: usize

The amount of zeroes to display if the decimal part is zero.

fixed_at: FixedAt

Whether to force a certain representation and if so, which one.

long_units: bool

Whether to use the full suffix or its abbreveation.

space: bool

Whether to place a space between value and units.

suffix: &'static str

An optional suffix which will be appended after the unit.

allow_negative: bool

Whether to allow negative numbers as input. If False, negative values will return an error.

Trait Implementations

impl AsRef<FileSizeOpts> for FileSizeOpts[src]

fn as_ref(&self) -> &FileSizeOpts[src]

Performs the conversion.

impl Debug for FileSizeOpts[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.