capsize

Trait Capacity

Source
pub trait Capacity {
    // Required method
    fn bytes(&self) -> i64;

    // Provided methods
    fn kilobytes(&self) -> i64 { ... }
    fn megabytes(&self) -> i64 { ... }
    fn gigabytes(&self) -> i64 { ... }
    fn terabytes(&self) -> i64 { ... }
    fn petabytes(&self) -> i64 { ... }
    fn exabytes(&self) -> i64 { ... }
    fn capacity(&self) -> String { ... }
}
Expand description

Capacity provides a simple way to convert values to corresponding units of capacity

Required Methods§

Source

fn bytes(&self) -> i64

size in bytes

Provided Methods§

Source

fn kilobytes(&self) -> i64

size in kilobytes

Source

fn megabytes(&self) -> i64

size in megabytes

Source

fn gigabytes(&self) -> i64

size in gigabytes

Source

fn terabytes(&self) -> i64

size in terabytes

Source

fn petabytes(&self) -> i64

size in petabytes

Source

fn exabytes(&self) -> i64

size in exabytes

Source

fn capacity(&self) -> String

size as a human readable string

Implementations on Foreign Types§

Source§

impl Capacity for i64

Source§

fn bytes(&self) -> i64

Implementors§