Enum byte_unit::ByteUnit

source ·
pub enum ByteUnit {
    B,
    KB,
    KiB,
    MB,
    MiB,
    GB,
    GiB,
    TB,
    TiB,
    PB,
    PiB,
}
Expand description

The unit of bytes.

Variants

B

1 B = 1 byte

KB

1 KB = 1000 bytes

KiB

1 KiB = 1024 bytes

MB

1 MB = 1000000 bytes

MiB

1 MiB = 1048576 bytes

GB

1 GB = 1000000000 bytes

GiB

1 GiB = 1073741824 bytes

TB

1 TB = 1000000000000 bytes

TiB

1 TiB = 1099511627776 bytes

PB

1 PB = 1000000000000000 bytes

PiB

1 PiB = 1125899906842624 bytes

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Formats the value using the given formatter. Read more
Feeds this value into the given Hasher. Read more
Feeds a slice of this type into the given Hasher. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
Converts the given value to a String. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.