Skip to main content
Module octets
- from_bits_u64
- Convert a bit count into a byte (octet) count.
- gib
- Multiply by 1024³ to express a byte count in gibibytes (GiB), saturating
at
usize::MAX instead of wrapping. - gib_u64
u64 variant of gib.- kib
- Multiply by 1024 to express a byte count in kibibytes (KiB), saturating
at
usize::MAX instead of wrapping. - kib_u32
u32 variant of kib.- kib_u64
u64 variant of kib.- mib
- Multiply by 1024² to express a byte count in mebibytes (MiB), saturating
at
usize::MAX instead of wrapping. - mib_u32
u32 variant of mib.- mib_u64
u64 variant of mib.- unpack_octets_as_u16
- A helper function that unpacks a sequence of 2 bytes found in the buffer with
starting at the given offset, into a u16.
- unpack_octets_as_u32
- A helper function that unpacks a sequence of 4 bytes found in the buffer with
starting at the given offset, into a u32.