Enum prse::ParseError

source ·
pub enum ParseError {
    Int(ParseIntError),
    Bool(ParseBoolError),
    Char(ParseCharError),
    Float(ParseFloatError),
    Addr(AddrParseError),
    Dyn(Box<dyn Error>),
    Literal {
        expected: String,
        found: String,
    },
    Multi {
        expected: u8,
        found: u8,
    },
}
Expand description

The error returned when trying to parse a type using try_parse or LendingFromStr.

Variants§

§

Int(ParseIntError)

The variant returned when an integer cannot be parsed.

§

Bool(ParseBoolError)

The variant returned when a bool cannot be parsed.

§

Char(ParseCharError)

The variant returned when a char cannot be parsed.

§

Float(ParseFloatError)

The variant returned when a float cannot be parsed.

§

Addr(AddrParseError)

The variant returned when an ip address cannot be parsed. This variant is only enabled with the std feature.

§

Dyn(Box<dyn Error>)

The variant returned when you want to return an error that is not defined here. When not using the std feature, Dyn is a unit variant as the Error trait is part of std.

§

Literal

Fields

§expected: String

What it expected.

§found: String

What it actually found.

The variant returned when parse! found an unexpected literal. When not using the alloc feature, Literal is a unit variant.

§

Multi

Fields

§expected: u8

The size of the array it was expecting.

§found: u8

The size of the array it found.

The variant returned when parsing an array and finding more or less elements than what was expected.

Trait Implementations§

Formats the value using the given formatter. Read more
Formats the value using the given formatter. Read more
The lower-level source of this error, if any. Read more
👎Deprecated since 1.42.0: use the Display impl or to_string()
👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

🔬This is a nightly-only experimental API. (provide_any)
Data providers should implement this method to provide all values they are able to provide by using demand. Read more
Converts the given value to a String. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.