#[non_exhaustive]
pub struct InvalidUtf8InPathParam { }
Expand description
One of the percent-decoded path parameters is not a valid UTF8 string.
URL parameters must be percent-encoded whenever they contain characters that are not
URL safe—e.g. whitespaces.
Pavex automatically percent-decodes URL parameters before trying to deserialize them
in PathParams<T>
.
This error is returned whenever the percent-decoding step fails—i.e. the decoded data is not a
valid UTF8 string.
§Example
One of our routes is /address/:address_id
.
We receive a request with /address/the%20street
as path—address_id
is set to
the%20street
and Pavex automatically decodes it into the street
.
We could also receive a request using /address/dirty%DE~%C7%1FY
as path—address_id
, when
decoded, is a sequence of bytes that cannot be interpreted as a well-formed UTF8 string.
This error is then returned.
Formats the value using the given formatter.
Read more
Formats the value using the given formatter.
Read more
Returns the lower-level source of this error, if any.
Read more
👎Deprecated since 1.42.0: use the Display impl or to_string()
👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
🔬This is a nightly-only experimental API. (error_generic_member_access
)
Provides type-based access to context intended for error reports.
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
Calls U::from(self)
.
That is, this conversion is whatever the implementation of
From<T> for U
chooses to do.
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.