pub trait ParseNumber: Sized {
// Required methods
fn parse(s: &str) -> Result<Self, ParseNumberError>;
fn parse_with_limits(s: &str, limit: Self) -> Result<Self, ParseNumberError>;
}Expand description
Parses a &str to a number and makes sure it doesn’t exceed a limit.
Required Methods§
Sourcefn parse(s: &str) -> Result<Self, ParseNumberError>
fn parse(s: &str) -> Result<Self, ParseNumberError>
Parses a number without exceeding MAX_PARSE_VALUE.
Sourcefn parse_with_limits(s: &str, limit: Self) -> Result<Self, ParseNumberError>
fn parse_with_limits(s: &str, limit: Self) -> Result<Self, ParseNumberError>
Parses a number without exceeding the given limit.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.