Expand description
Common types and functions for byte size handling
Macros§
- format
- Creates a
Stringusing interpolation of runtime expressions.
Structs§
- Human
Byte Range - Parse
Error - String
- A UTF-8–encoded, growable string.
Enums§
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§
Functions§
- parse
- Parses a human-readable byte size string into a byte count, e.g.
"1.5 KiB"to1536. - skip_
while - take_
while - to_
string - Formats
bytesas a human-readable string with one decimal, e.g."1.5 KiB". - to_
string_ with_ precision - Formats
bytesas a human-readable string withprecisiondecimals, e.g.to_string_with_precision(1 << 40, Format::IEC, 2)is"1.00 TiB".