Skip to main content

parse_limit

Function parse_limit 

Source
pub fn parse_limit(raw: &str) -> Result<usize, String>
Expand description

Parse a limit such as 128000, 128k, 2M or 1.5m.

Suffixes are decimal (k = 1 000, m = 1 000 000) because chat products advertise their limits that way. Zero and values that overflow are refused.