#[non_exhaustive]pub enum ErrorKind {
WrongNumberOfParameters {
got: usize,
expected: usize,
},
ParseErrorAtKey {
key: String,
value: String,
expected_type: &'static str,
},
ParseErrorAtIndex {
index: usize,
value: String,
expected_type: &'static str,
},
ParseError {
value: String,
expected_type: &'static str,
},
InvalidUtf8InPathParam {
key: String,
},
UnsupportedType {
name: &'static str,
},
Message(String),
}
Expand description
The kinds of errors that can happen we deserializing into a Path
.
This type is obtained through FailedToDeserializePathParams::kind
or
FailedToDeserializePathParams::into_kind
and is useful for building
more precise error messages.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
WrongNumberOfParameters
The URI contained the wrong number of parameters.
Fields
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
ParseErrorAtIndex
Failed to parse the value at a specific index into the expected type.
This variant is used when deserializing into sequence types, such as tuples.
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
InvalidUtf8InPathParam
A parameter contained text that, once percent decoded, wasn’t valid UTF-8.
UnsupportedType
Tried to serialize into an unsupported type such as 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
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 64 bytes
Size for each variant:
WrongNumberOfParameters
: 24 bytesParseErrorAtKey
: 64 bytesParseErrorAtIndex
: 56 bytesParseError
: 48 bytesInvalidUtf8InPathParam
: 32 bytesUnsupportedType
: 24 bytesMessage
: 32 bytes