#[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::into_kind and is useful for building more precise error messages.

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.

WrongNumberOfParameters

Fields

got: usize

The number of actual parameters in the URI.

expected: usize

The number of expected parameters.

The URI contained the wrong number of parameters.

ParseErrorAtKey

Fields

key: String

The key at which the value was located.

value: String

The value from the URI.

expected_type: &'static str

The expected type of the value.

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.

ParseErrorAtIndex

Fields

index: usize

The index at which the value was located.

value: String

The value from the URI.

expected_type: &'static str

The expected type of the value.

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.

ParseError

Fields

value: String

The value from the URI.

expected_type: &'static str

The expected type of the value.

Failed to parse a value into the expected type.

This variant is used when deserializing into a primitive type (such as String and u32).

InvalidUtf8InPathParam

Fields

key: String

The key at which the invalid value was located.

A parameter contained text that, once percent decoded, wasn’t valid UTF-8.

UnsupportedType

Fields

name: &'static str

The name of the unsupported type.

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)

Tuple Fields

0: String

Catch-all variant for errors that don’t fit any other variant.

Trait Implementations

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

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

Performs the conversion.

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

Performs the conversion.

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more

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