Skip to main content

ByteSize

Trait ByteSize 

Source
pub trait ByteSize {
    // Required methods
    fn bytes(self) -> u64;
    fn kilobytes(self) -> u64;
    fn megabytes(self) -> u64;
    fn gigabytes(self) -> u64;
    fn terabytes(self) -> u64;
    fn petabytes(self) -> u64;
    fn exabytes(self) -> u64;
}
Expand description

Binary byte-size conversions.

Required Methods§

Source

fn bytes(self) -> u64

Returns the value in bytes.

Source

fn kilobytes(self) -> u64

Returns the value in kibibytes.

Source

fn megabytes(self) -> u64

Returns the value in mebibytes.

Source

fn gigabytes(self) -> u64

Returns the value in gibibytes.

Source

fn terabytes(self) -> u64

Returns the value in tebibytes.

Source

fn petabytes(self) -> u64

Returns the value in pebibytes.

Source

fn exabytes(self) -> u64

Returns the value in exbibytes.

Implementations on Foreign Types§

Source§

impl ByteSize for f64

Source§

fn bytes(self) -> u64

Source§

fn kilobytes(self) -> u64

Source§

fn megabytes(self) -> u64

Source§

fn gigabytes(self) -> u64

Source§

fn terabytes(self) -> u64

Source§

fn petabytes(self) -> u64

Source§

fn exabytes(self) -> u64

Source§

impl ByteSize for i32

Source§

fn bytes(self) -> u64

Source§

fn kilobytes(self) -> u64

Source§

fn megabytes(self) -> u64

Source§

fn gigabytes(self) -> u64

Source§

fn terabytes(self) -> u64

Source§

fn petabytes(self) -> u64

Source§

fn exabytes(self) -> u64

Source§

impl ByteSize for i64

Source§

fn bytes(self) -> u64

Source§

fn kilobytes(self) -> u64

Source§

fn megabytes(self) -> u64

Source§

fn gigabytes(self) -> u64

Source§

fn terabytes(self) -> u64

Source§

fn petabytes(self) -> u64

Source§

fn exabytes(self) -> u64

Source§

impl ByteSize for u32

Source§

fn bytes(self) -> u64

Source§

fn kilobytes(self) -> u64

Source§

fn megabytes(self) -> u64

Source§

fn gigabytes(self) -> u64

Source§

fn terabytes(self) -> u64

Source§

fn petabytes(self) -> u64

Source§

fn exabytes(self) -> u64

Source§

impl ByteSize for u64

Source§

fn bytes(self) -> u64

Source§

fn kilobytes(self) -> u64

Source§

fn megabytes(self) -> u64

Source§

fn gigabytes(self) -> u64

Source§

fn terabytes(self) -> u64

Source§

fn petabytes(self) -> u64

Source§

fn exabytes(self) -> u64

Implementors§