mirror of
https://github.com/tokio-rs/axum.git
synced 2026-08-24 00:00:16 +02:00
Remove take_* methods from RequestParts for Version, Method, and Uri (#151)
* Remove `RequestParts::take_method` * Remove `RequestParts::take_uri` * Remove `RequestParts::take_version`
This commit is contained in:
@@ -10,27 +10,6 @@ use http_body::Full;
|
||||
use std::convert::Infallible;
|
||||
use tower::BoxError;
|
||||
|
||||
define_rejection! {
|
||||
#[status = INTERNAL_SERVER_ERROR]
|
||||
#[body = "Version taken by other extractor"]
|
||||
/// Rejection used if the HTTP version has been taken by another extractor.
|
||||
pub struct VersionAlreadyExtracted;
|
||||
}
|
||||
|
||||
define_rejection! {
|
||||
#[status = INTERNAL_SERVER_ERROR]
|
||||
#[body = "URI taken by other extractor"]
|
||||
/// Rejection used if the URI has been taken by another extractor.
|
||||
pub struct UriAlreadyExtracted;
|
||||
}
|
||||
|
||||
define_rejection! {
|
||||
#[status = INTERNAL_SERVER_ERROR]
|
||||
#[body = "Method taken by other extractor"]
|
||||
/// Rejection used if the method has been taken by another extractor.
|
||||
pub struct MethodAlreadyExtracted;
|
||||
}
|
||||
|
||||
define_rejection! {
|
||||
#[status = INTERNAL_SERVER_ERROR]
|
||||
#[body = "Extensions taken by other extractor"]
|
||||
@@ -222,7 +201,6 @@ composite_rejection! {
|
||||
/// Contains one variant for each way the [`Query`](super::Query) extractor
|
||||
/// can fail.
|
||||
pub enum QueryRejection {
|
||||
UriAlreadyExtracted,
|
||||
FailedToDeserializeQueryString,
|
||||
}
|
||||
}
|
||||
@@ -237,9 +215,7 @@ composite_rejection! {
|
||||
FailedToDeserializeQueryString,
|
||||
FailedToBufferBody,
|
||||
BodyAlreadyExtracted,
|
||||
UriAlreadyExtracted,
|
||||
HeadersAlreadyExtracted,
|
||||
MethodAlreadyExtracted,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user