mirror of
https://github.com/tokio-rs/axum.git
synced 2026-08-29 00:00:18 +02:00
Support extracting URL params multiple times (#15)
Useful when building higher order extractors.
This commit is contained in:
@@ -127,13 +127,6 @@ define_rejection! {
|
||||
pub struct MissingRouteParams;
|
||||
}
|
||||
|
||||
define_rejection! {
|
||||
#[status = INTERNAL_SERVER_ERROR]
|
||||
#[body = "Cannot have two URL capture extractors for a single handler"]
|
||||
/// Rejection type used if you try and extract the URL params more than once.
|
||||
pub struct UrlParamsAlreadyExtracted;
|
||||
}
|
||||
|
||||
define_rejection! {
|
||||
#[status = INTERNAL_SERVER_ERROR]
|
||||
#[body = "Cannot have two request body extractors for a single handler"]
|
||||
@@ -288,17 +281,6 @@ composite_rejection! {
|
||||
}
|
||||
}
|
||||
|
||||
composite_rejection! {
|
||||
/// Rejection used for [`UrlParamsMap`](super::UrlParamsMap).
|
||||
///
|
||||
/// Contains one variant for each way the [`UrlParamsMap`](super::UrlParamsMap) extractor
|
||||
/// can fail.
|
||||
pub enum UrlParamsMapRejection {
|
||||
UrlParamsAlreadyExtracted,
|
||||
MissingRouteParams,
|
||||
}
|
||||
}
|
||||
|
||||
composite_rejection! {
|
||||
/// Rejection used for [`UrlParams`](super::UrlParams).
|
||||
///
|
||||
@@ -306,7 +288,6 @@ composite_rejection! {
|
||||
/// can fail.
|
||||
pub enum UrlParamsRejection {
|
||||
InvalidUrlParam,
|
||||
UrlParamsAlreadyExtracted,
|
||||
MissingRouteParams,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user