Enum byte_unit::ByteUnit[][src]

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

The unit of bytes.

Variants

1 B = 1 byte

1 KB = 1000 bytes

1 KiB = 1024 bytes

1 MB = 1000000 bytes

1 MiB = 1048576 bytes

1 GB = 1000000000 bytes

1 GiB = 1073741824 bytes

1 TB = 1000000000000 bytes

1 TiB = 1099511627776 bytes

1 PB = 1000000000000000 bytes

1 PiB = 1125899906842624 bytes

Trait Implementations

impl Debug for ByteUnit
[src]

Formats the value using the given formatter. Read more

impl PartialEq for ByteUnit
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Clone for ByteUnit
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl ToString for ByteUnit
[src]

Get the unit string.

Examples

extern crate byte_unit;

use byte_unit::ByteUnit;

let result = ByteUnit::KB.to_string();

assert_eq!(result, "KB");

Auto Trait Implementations

impl Send for ByteUnit

impl Sync for ByteUnit