#[non_exhaustive]pub enum ErrorKind {
ParseErrorAtKey {
key: String,
value: String,
expected_type: &'static str,
},
ParseError {
value: String,
expected_type: &'static str,
},
UnsupportedType {
name: &'static str,
},
Message(String),
}
Expand description
The kinds of errors that can happen when deserializing into a PathParams
.
This type is obtained through PathDeserializationError::kind
and is useful for building
more precise error messages (e.g. implementing your own custom conversion from
PathDeserializationError
into an HTTP response).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
ParseErrorAtKey
Failed to parse the value at a specific key into the expected type.
This variant is used when deserializing into types that have named fields, such as structs.
Fields
ParseError
Failed to parse a value into the expected type.
This variant is used when deserializing into a primitive type (such as String
and u32
).
Fields
UnsupportedType
Tried to serialize into an unsupported type such as collections, tuples or nested maps.
This error kind is caused by programmer errors and thus gets converted into a 500 Internal Server Error
response.
Message(String)
Catch-all variant for errors that don’t fit any other variant.
Trait Implementations§
impl Eq for ErrorKind
impl StructuralPartialEq for ErrorKind
Auto Trait Implementations§
impl Freeze for ErrorKind
impl RefUnwindSafe for ErrorKind
impl Send for ErrorKind
impl Sync for ErrorKind
impl Unpin for ErrorKind
impl UnwindSafe for ErrorKind
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.