logo
#[non_exhaustive]
pub enum ErrorKind<'v> {
Show 16 variants InvalidLength { min: Option<u64>, max: Option<u64>, }, InvalidChoice { choices: Cow<'v, [Cow<'v, str>]>, }, OutOfRange { start: Option<isize>, end: Option<isize>, }, Validation(Cow<'v, str>), Duplicate, Missing, Unexpected, Unknown, Custom(Box<dyn Error + Send>), Multipart(Error), Utf8(Utf8Error), Int(ParseIntError), Bool(ParseBoolError), Float(ParseFloatError), Addr(AddrParseError), Io(Error),
}
Expand description

The kind of form error that occurred.

Constructing

An ErrorKind can be constructed directly or via a From of the following types:

Variants (Non-exhaustive)

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.

InvalidLength

Fields

min: Option<u64>

The minimum length required, inclusive.

max: Option<u64>

The maximum length required, inclusize.

The value’s length, in bytes, was outside the range [min, max].

InvalidChoice

Fields

choices: Cow<'v, [Cow<'v, str>]>

The choices that were expected.

The value wasn’t one of the valid choices.

OutOfRange

Fields

start: Option<isize>

The start of the acceptable range, inclusive.

end: Option<isize>

The end of the acceptable range, inclusive.

The integer value was outside the range [start, end].

Validation(Cow<'v, str>)

A custom validation routine failed with message .0.

Duplicate

One entity was expected but more than one was received.

Missing

An entity was expected but was not received.

Unexpected

An unexpected entity was received.

Unknown

An unknown entity was received.

Custom(Box<dyn Error + Send>)

A custom error occurred.

Multipart(Error)

An error while parsing a multipart form occurred.

Utf8(Utf8Error)

A string was invalid UTF-8.

Int(ParseIntError)

A value failed to parse as an integer.

Bool(ParseBoolError)

A value failed to parse as a boolean.

Float(ParseFloatError)

A value failed to parse as a float.

Addr(AddrParseError)

A value failed to parse as an IP or socket address.

Io(Error)

An I/O error occurred.

Trait Implementations

Formats the value using the given formatter. Read more

Formats the value using the given formatter. 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.

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.

Converts to this type from the input type.

The owned version of the type.

Converts self into an owned version of itself.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

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

Converts self into a collection.

Should always be Self

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.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more