Expand description
§size_fmt
This library formats sizes in a human readable format.
The API and Implementation is inspired by dtolnay/itoa.
§Features
- Supports no-std.
- No heap allocations.
- Does not go through
core::fmt::Formatter.
§Example
fn main() {
let mut buffer = size_fmt::Buffer::new();
let printed = buffer.human_fmt(4096);
assert_eq!(printed, "4.0K")
}Structs§
- Buffer
- A correctly sized stack allocated array of bytes for the formatted size to be written into.
Traits§
- Integer
- An integer that can be written into a [
size_fmt::Buffer].