#[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:
(Option<u64>, Option<u64>)
=>ErrorKind::InvalidLength
(Option<ByteUnit>, Option<ByteUnit>)
=>ErrorKind::InvalidLength
(Option<isize>, Option<isize>)
=>ErrorKind::OutOfRange
&[Cow<'_, str>]
orVec<Cow<'_, str>>
=>ErrorKind::InvalidChoice
Utf8Error
=>ErrorKind::Utf8
ParseIntError
=>ErrorKind::Int
ParseFloatError
=>ErrorKind::Float
ParseBoolError
=>ErrorKind::Bool
AddrParseError
=>ErrorKind::Addr
io::Error
=>ErrorKind::Io
Box<dyn std::error::Error + Send
=>ErrorKind::Custom
Variants (Non-exhaustive)
This enum is marked as non-exhaustive
InvalidLength
Fields
The value’s length, in bytes, was outside the range [min, max]
.
InvalidChoice
The value wasn’t one of the valid choices
.
OutOfRange
Fields
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
sourceimpl<'a> From<AddrParseError> for ErrorKind<'a>
impl<'a> From<AddrParseError> for ErrorKind<'a>
sourcefn from(value: AddrParseError) -> Self
fn from(value: AddrParseError) -> Self
Converts to this type from the input type.
sourceimpl<'a> From<ParseBoolError> for ErrorKind<'a>
impl<'a> From<ParseBoolError> for ErrorKind<'a>
sourcefn from(value: ParseBoolError) -> Self
fn from(value: ParseBoolError) -> Self
Converts to this type from the input type.
sourceimpl<'a> From<ParseFloatError> for ErrorKind<'a>
impl<'a> From<ParseFloatError> for ErrorKind<'a>
sourcefn from(value: ParseFloatError) -> Self
fn from(value: ParseFloatError) -> Self
Converts to this type from the input type.
sourceimpl<'a> From<ParseIntError> for ErrorKind<'a>
impl<'a> From<ParseIntError> for ErrorKind<'a>
sourcefn from(value: ParseIntError) -> Self
fn from(value: ParseIntError) -> Self
Converts to this type from the input type.
Auto Trait Implementations
impl<'v> !RefUnwindSafe for ErrorKind<'v>
impl<'v> Send for ErrorKind<'v>
impl<'v> !Sync for ErrorKind<'v>
impl<'v> Unpin for ErrorKind<'v>
impl<'v> !UnwindSafe for ErrorKind<'v>
Blanket Implementations
impl<'a, T> AsTaggedExplicit<'a> for T where
T: 'a,
impl<'a, T> AsTaggedExplicit<'a> for T where
T: 'a,
fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self>
impl<'a, T> AsTaggedImplicit<'a> for T where
T: 'a,
impl<'a, T> AsTaggedImplicit<'a> for T where
T: 'a,
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<T> IntoCollection<T> for T
impl<T> IntoCollection<T> for T
fn into_collection<A>(self) -> SmallVec<A> where
A: Array<Item = T>,
fn into_collection<A>(self) -> SmallVec<A> where
A: Array<Item = T>,
Converts self
into a collection.
fn mapped<U, F, A>(self, f: F) -> SmallVec<A> where
F: FnMut(T) -> U,
A: Array<Item = U>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more