Trait SizeExt
Source pub trait SizeExt {
// Required methods
fn bytes(self) -> ByteSize;
fn kib(self) -> ByteSize;
fn mib(self) -> ByteSize;
fn gib(self) -> ByteSize;
}
Expand description
Helper trait for readable byte sizes.
Implemented for common integer types so that literals like 512.mib()
or 1.gib() return a ByteSize that converts into either Bytes
or Mebibytes.
Create a ByteSize representing this many bytes.
Create a ByteSize representing this many kibibytes (×1024).
Create a ByteSize representing this many mebibytes (×1024²).
Create a ByteSize representing this many gibibytes (×1024³).