Expand description
Byte-size parsing, display, and integer encoding helpers.
The module handles human-readable sizes alongside fixed-width big-endian counters. Its size deserializers integrate human-readable values with Serde.
Re-exportsยง
use std::fmt;๐use std::fmt::Display;๐use std::fmt::Formatter;๐use std::fmt::Write;๐use bytesize::ByteSize;๐use serde::Deserialize;๐use serde::Deserialize;๐use serde::Deserializer;๐use serde::de;๐use crate::Result;๐use crate::at;๐use crate::err;๐
Structsยง
- Escaped
Bytes ๐
Functionsยง
- deserialize_
bytesize_ u64 - Accepts an integer byte count or a string with SI/IEC suffix (e.g. โ32 MiBโ)
and returns a
u64. - deserialize_
bytesize_ usize - Accepts an integer byte count or a string with SI/IEC suffix (e.g. โ24 MiBโ)
and returns a
usize. - escape_
bytes - Renders bytes as text, writing each non-printable byte as
\xHH. - from_
str - Parse a human-writable size string w/ si-unit suffix into integer
- increment
- Increments an optional big-endian counter with wrapping arithmetic.
- prefix_
successor - Returns the least byte prefix strictly after every key with this prefix.
- pretty
- Output a human-readable size string w/ iec-unit suffix
- u64_
from_ bytes - Parses the big-endian bytes into an u64.
- u64_
from_ u8 - Parses 8 big-endian bytes into an u64; panic on invalid argument