Crate human_size [−] [src]
The human_size
represents sizes for humans. The main type is Size
,
which (as the name might suggests) represents a size in multiple of bytes.
Example
Below is small example that parses a size from a string, prints it and get the size in bytes.
use human_size::Size; let size = "100 KB".parse::<Size>().unwrap(); println!("size: {}", size); // 100 KB let bytes = size.into_bytes(); println!("size in bytes: {}", bytes); // 102400
Structs
Size |
|
Enums
Multiple |
A |
ParsingError |
The error returned when trying to parse a |