Trait memu::MemoryUnit

source ·
pub trait MemoryUnit {
    // Required methods
    fn as_bits(&self) -> u128;
    fn as_byte(&self) -> Byte;
    fn as_kilo_byte(&self) -> KiloByte;
    fn as_mega_byte(&self) -> MegaByte;
    fn as_giga_byte(&self) -> GigaByte;
    fn as_tera_byte(&self) -> TeraByte;
    fn as_peta_byte(&self) -> PetaByte;
}
Expand description

Trait for converting between memory units.

Required Methods§

source

fn as_bits(&self) -> u128

Converts the unit into bits.

source

fn as_byte(&self) -> Byte

Converts the unit into Bytes.

source

fn as_kilo_byte(&self) -> KiloByte

Converts the unit into KiloBytes.

source

fn as_mega_byte(&self) -> MegaByte

Converts the unit into MegaBytes.

source

fn as_giga_byte(&self) -> GigaByte

Converts the unit into GigaBytes.

source

fn as_tera_byte(&self) -> TeraByte

Converts the unit into TeraBytes.

source

fn as_peta_byte(&self) -> PetaByte

Converts the unit into PetaBytes.

Implementors§