Skip to main content

parse_size_bytes

Function parse_size_bytes 

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

Parse a human-readable byte size ("50MB", "500 KB", "1GiB", "1024"). Decimal units (KB/MB/GB) are 1000-based; binary units (KiB/MiB/GiB) are 1024-based; a bare number (or B) is bytes. Case-insensitive. Shared by collect.max_size validation and the agent’s bundle-size enforcement.