Struct FormatSizeOptions
struct FormatSizeOptions { ... }
Holds the options for the file_size method.
Fields
base_unit: BaseUnitWhether the value being formatted represents an amount of bits or bytes.
kilo: 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: Option<FixedAt>Whether to force a certain representation and if so, which one.
long_units: boolWhether to use the full unit (e.g.
Kilobyte) or its abbreviation (kB).space_after_value: boolWhether to place a space between value and units.
suffix: &'static strAn optional suffix which will be appended after the unit. Useful to represent speeds (e.g. `1 kB/s)
Implementations
impl FormatSizeOptions
fn from(from: FormatSizeOptions) -> FormatSizeOptionsfn base_unit(self: Self, base_unit: BaseUnit) -> FormatSizeOptionsfn kilo(self: Self, kilo: Kilo) -> FormatSizeOptionsfn units(self: Self, units: Kilo) -> FormatSizeOptionsfn decimal_places(self: Self, decimal_places: usize) -> FormatSizeOptionsfn decimal_zeroes(self: Self, decimal_zeroes: usize) -> FormatSizeOptionsfn fixed_at(self: Self, fixed_at: Option<FixedAt>) -> FormatSizeOptionsfn long_units(self: Self, long_units: bool) -> FormatSizeOptionsfn space_after_value(self: Self, insert_space: bool) -> FormatSizeOptionsfn suffix(self: Self, suffix: &'static str) -> FormatSizeOptions
impl AsRef for FormatSizeOptions
fn as_ref(self: &Self) -> &FormatSizeOptions
impl Clone for FormatSizeOptions
fn clone(self: &Self) -> FormatSizeOptions
impl Copy for FormatSizeOptions
impl Debug for FormatSizeOptions
fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result
impl Default for FormatSizeOptions
fn default() -> FormatSizeOptions
impl Freeze for FormatSizeOptions
impl RefUnwindSafe for FormatSizeOptions
impl Send for FormatSizeOptions
impl Sync for FormatSizeOptions
impl Unpin for FormatSizeOptions
impl UnsafeUnpin for FormatSizeOptions
impl UnwindSafe for FormatSizeOptions
impl<T> Any for FormatSizeOptions
fn type_id(self: &Self) -> TypeId
impl<T> Borrow for FormatSizeOptions
fn borrow(self: &Self) -> &T
impl<T> BorrowMut for FormatSizeOptions
fn borrow_mut(self: &mut Self) -> &mut T
impl<T> CloneToUninit for FormatSizeOptions
unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)
impl<T> From for FormatSizeOptions
fn from(t: T) -> TReturns the argument unchanged.
impl<T> ToOwned for FormatSizeOptions
fn to_owned(self: &Self) -> Tfn clone_into(self: &Self, target: &mut T)
impl<T, U> Into for FormatSizeOptions
fn into(self: Self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom for FormatSizeOptions
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto for FormatSizeOptions
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>