Expand description
Byte-size types and conversion helpers.
Provides ByteSize, Bytes, and Mebibytes for type-safe size
specification across the project. The SizeExt trait adds .bytes(),
.kib(), .mib(), and .gib() helpers to integer literals.
ⓘ
use microsandbox_utils::size::{SizeExt, Mebibytes};
// All equivalent — 512 MiB:
let a: Mebibytes = 512.into(); // bare integer
let b: Mebibytes = 512.mib().into(); // explicit unit
// Cross-unit conversion:
let c: Mebibytes = 1.gib().into(); // 1 GiB → 1024 MiBStructs§
- Byte
Size - A byte-size value returned by
SizeExthelpers. - Bytes
- A size measured in bytes.
- Mebibytes
- A size measured in mebibytes (MiB).
Traits§
- SizeExt
- Helper trait for readable byte sizes.