Skip to main content

Module sizes

Module sizes 

Source
Expand description

Rust implementation of sizes formatting and parsing, matching zircon/system/ulib/pretty.

Enums§

SizeUnit
Units for formatting byte sizes.

Constants§

MAX_FORMAT_SIZE_LEN

Functions§

format_size_fixed_rs
Formats |bytes| as a human-readable string like “123.4k”. Units are in powers of 1024, so “K” is technically “kiB”, etc. Values smaller than “K” have the suffix “B”.
format_size_rs
Calls format_size_fixed_rs() with unit=0, picking a natural unit for the size.
parse_size_bytes
Returns the number of bytes represented by a human readable string like “123.4k”, 123.4 * 1024 bytes encoded in |formatted_bytes|.