pub trait FromStrRadix: Sized {
type Err;
// Required method
fn from_str_radix(str: &str, radix: u32) -> Result<Self, Self::Err>;
}Expand description
Conversion from a string in a given radix.
This is the standalone atom for the parsing capability that Num
bundles; implement both for full compatibility. (Num keeps its own
FromStrRadixErr associated type and method because associated types
can’t be re-exported through supertraits.)
This is a plain (never-const) trait: string parsing is not const-evaluable for any of the primitive types today.
Required Associated Types§
Required Methods§
Sourcefn from_str_radix(str: &str, radix: u32) -> Result<Self, Self::Err>
fn from_str_radix(str: &str, radix: u32) -> Result<Self, Self::Err>
Convert from a string and radix (typically 2..=36); see
Num::from_str_radix for the conventions around supported
radices.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".