pub trait ParseNumber {
// Required methods
fn parse_sym<F: FromStr>(
&self,
sym: &NumberSymbols,
) -> Result<F, NumberFmtError>;
fn parse_fmt<F: FromStr>(
&self,
fmt: &NumberFormat,
) -> Result<F, NumberFmtError>;
}Expand description
Parses a number from a &str.
Required Methods§
Sourcefn parse_sym<F: FromStr>(
&self,
sym: &NumberSymbols,
) -> Result<F, NumberFmtError>
fn parse_sym<F: FromStr>( &self, sym: &NumberSymbols, ) -> Result<F, NumberFmtError>
Parse the number after applying core::clean_num(). This removes everything but digits, decimal sym and sign and then parses. Uses the given symbols for the translation.
Sourcefn parse_fmt<F: FromStr>(&self, fmt: &NumberFormat) -> Result<F, NumberFmtError>
fn parse_fmt<F: FromStr>(&self, fmt: &NumberFormat) -> Result<F, NumberFmtError>
Parse the number after applying core::unmap_num() Creates a raw number by unapplying the exact pattern.
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.