bytesize

Types

pub type ByteSize {
  ByteSize(Int)
}

Constructors

  • ByteSize(Int)

Constants

pub const b_bytes: Int

byte size for 1 byte

pub const gb_bytes: Int

bytes size for 1 gigabyte

pub const gib_bytes: Int

bytes size for 1 gibibyte

pub const kb_bytes: Int

bytes size for 1 kilobyte

pub const kib_bytes: Int

bytes size for 1 kibibyte

pub const mb_bytes: Int

bytes size for 1 megabyte

pub const mib_bytes: Int

bytes size for 1 mebibyte

pub const pb_bytes: Int

bytes size for 1 petabyte

pub const pib_bytes: Int

bytes size for 1 pebibyte

pub const tb_bytes: Int

bytes size for 1 terabyte

pub const tib_bytes: Int

bytes size for 1 tebibyte

Functions

pub fn b(size: Int) -> ByteSize
pub fn bytes(size: ByteSize) -> Int
pub fn gb(size: Int) -> ByteSize
pub fn gib(size: Int) -> ByteSize
pub fn kb(size: Int) -> ByteSize

Create a ByteSize from size kB

pub fn kib(size: Int) -> ByteSize
pub fn mb(size: Int) -> ByteSize
pub fn mib(size: Int) -> ByteSize
pub fn pb(size: Int) -> ByteSize
pub fn pib(size: Int) -> ByteSize
pub fn tb(size: Int) -> ByteSize
pub fn tib(size: Int) -> ByteSize
pub fn to_string(size: ByteSize) -> String
pub fn to_string_decimal(size: ByteSize) -> String
Search Document