Skip to main content

Crate humanbyte

Crate humanbyte 

Source
Expand description

Common types and functions for byte size handling

Macros§

format
Creates a String using interpolation of runtime expressions.

Structs§

HumanByteRange
ParseError
String
A UTF-8–encoded, growable string.

Enums§

Cow
A clone-on-write smart pointer.
Format
Unit

Constants§

B
byte size for 1 byte
EB
bytes size for 1 exabyte
EIB
bytes size for 1 exbibyte
GB
bytes size for 1 gigabyte
GIB
bytes size for 1 gibibyte
KB
bytes size for 1 kilobyte
KIB
bytes size for 1 kibibyte
MB
bytes size for 1 megabyte
MIB
bytes size for 1 mebibyte
PB
bytes size for 1 petabyte
PIB
bytes size for 1 pebibyte
TB
bytes size for 1 terabyte
TIB
bytes size for 1 tebibyte

Traits§

FromStr
Parse a value from a string
ToString
A trait for converting a value to a String.

Functions§

parse
Parses a human-readable byte size string into a byte count, e.g. "1.5 KiB" to 1536.
skip_while
take_while
to_string
Formats bytes as a human-readable string with one decimal, e.g. "1.5 KiB".
to_string_with_precision
Formats bytes as a human-readable string with precision decimals, e.g. to_string_with_precision(1 << 40, Format::IEC, 2) is "1.00 TiB".