mirror of
https://github.com/tokio-rs/axum.git
synced 2026-09-08 00:00:24 +02:00
Add OptionalPath extractor (#1889)
Co-authored-by: David Pedersen <[email protected]>
This commit is contained in:
co-authored by
David Pedersen
parent
946d8c3253
commit
43b2d52403
@@ -266,7 +266,8 @@ impl std::error::Error for PathDeserializationError {}
|
||||
|
||||
/// 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
|
||||
/// This type is obtained through [`FailedToDeserializePathParams::kind`] or
|
||||
/// [`FailedToDeserializePathParams::into_kind`] and is useful for building
|
||||
/// more precise error messages.
|
||||
#[derive(Debug, PartialEq, Eq)]
|
||||
#[non_exhaustive]
|
||||
@@ -380,6 +381,11 @@ impl fmt::Display for ErrorKind {
|
||||
pub struct FailedToDeserializePathParams(PathDeserializationError);
|
||||
|
||||
impl FailedToDeserializePathParams {
|
||||
/// Get a reference to the underlying error kind.
|
||||
pub fn kind(&self) -> &ErrorKind {
|
||||
&self.0.kind
|
||||
}
|
||||
|
||||
/// Convert this error into the underlying error kind.
|
||||
pub fn into_kind(self) -> ErrorKind {
|
||||
self.0.kind
|
||||
|
||||
Reference in New Issue
Block a user