Skip to main content

parse_bytes

Function parse_bytes 

Source
pub fn parse_bytes(s: &str) -> Result<u64, String>
Expand description

Parse a human size: 256MB, 1.5GiB, 524288000. Decimal and binary prefixes both mean binary here — an operator writing 256MB for a threshold wants “about a quarter gig”, and the 4.8% difference is noise against a knob whose purpose is “not zero”.