pub trait FromStr: Sized {
    type Error: Error + Send + Sync + 'static;

    // Required method
    fn from_str(s: &str) -> Result<Self, Self::Error>;
}
Expand description

Defines the way to parse the object from a UTF-8 string.

This is like the standard FromStr trait, except that it imposes additional bounds on the error type to make it more usable for aggregation to higher level errors and passing between threads.

Required Associated Types§

Source

type Error: Error + Send + Sync + 'static

Required Methods§

Source

fn from_str(s: &str) -> Result<Self, Self::Error>

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.

Implementors§

Source§

impl<T> FromStr for T
where T: FromStr, <T as FromStr>::Err: Error + Send + Sync + 'static,

Source§

type Error = <T as FromStr>::Err