Expand description
Human-readable size parsing and platform presets.
Sizes (8MB, 500KB, 1.5GB) → bytes. Decimal units (KB/MB/GB) use 1000,
binary units (KiB/MiB/GiB) use 1024. Decimal is the deliberate default:
for the same number it is smaller than binary, so a “≤ 8 MB” goal stays
conservative even on platforms that mean 8 MiB when they say “8 MB”.
Structs§
- Preset
- A platform preset: a name and a hard limit in bytes (if any).
Enums§
- Size
Error - Errors from parsing a size or a percent.
Functions§
- parse_
percent - Parse a percent like
70%or70into the fraction0.70. Range is strictly (0, 100). - parse_
size - Parse a size like
8MB,500KB,1.5GB,1024KiB,900000into bytes. - preset
- Look up a preset by name. Limit values are TO BE VERIFIED AT RELEASE: platforms change them.