Expand description
Parse a human byte size (4MiB, 1048576, 2M) for CLI value_parsers.
Binary units only: K/KiB/KB = 1024, M/MiB/MB = 1024², G/GiB/GB = 1024³.
Functions§
- parse_
byte_ size - Parse a byte size: a bare integer (bytes) or an integer followed by a
binary unit suffix (
K/KiB/KB,M/MiB/MB,G/GiB/GB, all powers of 1024). Returns the size in bytes. The error is aStringso it renders directly in clap’svalue_parserdiagnostics.