Struct FormatSizeOptions

struct FormatSizeOptions { ... }

Holds the options for the file_size method.

Fields

base_unit: BaseUnit

Whether the value being formatted represents an amount of bits or bytes.

kilo: 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: Option<FixedAt>

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

long_units: bool

Whether to use the full unit (e.g. Kilobyte) or its abbreviation (kB).

space_after_value: bool

Whether to place a space between value and units.

suffix: &'static str

An 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) -> FormatSizeOptions
fn base_unit(self: Self, base_unit: BaseUnit) -> FormatSizeOptions
fn kilo(self: Self, kilo: Kilo) -> FormatSizeOptions
fn units(self: Self, units: Kilo) -> FormatSizeOptions
fn decimal_places(self: Self, decimal_places: usize) -> FormatSizeOptions
fn decimal_zeroes(self: Self, decimal_zeroes: usize) -> FormatSizeOptions
fn fixed_at(self: Self, fixed_at: Option<FixedAt>) -> FormatSizeOptions
fn long_units(self: Self, long_units: bool) -> FormatSizeOptions
fn space_after_value(self: Self, insert_space: bool) -> FormatSizeOptions
fn 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) -> T

Returns the argument unchanged.

impl<T> ToOwned for FormatSizeOptions

fn to_owned(self: &Self) -> T
fn clone_into(self: &Self, target: &mut T)

impl<T, U> Into for FormatSizeOptions

fn into(self: Self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses 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>