Trait ParseInput

Source
pub trait ParseInput: Sized {
    type Error: Error;

    // Required method
    fn parse(value: String) -> Result<Self, Self::Error>;
}

Required Associated Types§

Required Methods§

Source

fn parse(value: String) -> Result<Self, Self::Error>

Parse input string to type T.

§Errors

When the string value cannot be parsed as Self.

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.

Implementations on Foreign Types§

Source§

impl ParseInput for bool

Source§

type Error = ParseError

Source§

fn parse(value: String) -> Result<Self, Self::Error>

Source§

impl ParseInput for String

Source§

type Error = Infallible

Source§

fn parse(value: String) -> Result<Self, Self::Error>

Implementors§