Expand description
Module to allow the display of bandwidth in binary prefix system
§Conversion
Unlike the international system, the binary system uses powers of 2 instead of powers of 10. More over the base unit here is Byte (or octet) per second and not bit per second, for reminder 1 Byte = 8 bits.
Examples:
1B/sis equal to8bps1kiB/sis equal to8.192kbps1MiBpsis equal to8.388_608kbps
§Example
use bandwidth::Bandwidth;
use human_bandwidth::binary_system::format_binary_bandwidth;
let val = Bandwidth::new(0, 32 * 1024 * 1024);
assert_eq!(format_binary_bandwidth(val).to_string(), "4MiB/s");Modules§
- serde
- Serde support for humanized bandwidth in binary prefix format.
Structs§
- Formatted
Binary Bandwidth - A wrapper type that allows you to Display a
Bandwidthin binary prefix system
Functions§
- format_
binary_ bandwidth - Formats bandwidth into a human-readable string using the binary prefix system
- parse_
binary_ bandwidth - Parse bandwidth object
1GiBps 12MiBps 5Bpsor1.012000005GiBps