pub struct Request<T> { /* private fields */ }
Expand description
Represents an HTTP request.
An HTTP request consists of a head and a potentially optional body. The body
component is generic, enabling arbitrary types to represent the HTTP body.
For example, the body could be Vec<u8>
, a Stream
of byte chunks, or a
value that has been deserialized.
§Examples
Creating a Request
to send
use http::{Request, Response};
let mut request = Request::builder()
.uri("https://www.rust-lang.org/")
.header("User-Agent", "my-awesome-agent/1.0");
if needs_awesome_header() {
request = request.header("Awesome", "yes");
}
let response = send(request.body(()).unwrap());
fn send(req: Request<()>) -> Response<()> {
// ...
}
Inspecting a request to see what was sent.
use http::{Request, Response, StatusCode};
fn respond_to(req: Request<()>) -> http::Result<Response<()>> {
if req.uri() != "/awesome-url" {
return Response::builder()
.status(StatusCode::NOT_FOUND)
.body(())
}
let has_awesome_header = req.headers().contains_key("Awesome");
let body = req.body();
// ...
}
Deserialize a request of bytes via json:
use http::Request;
use serde::de;
fn deserialize<T>(req: Request<Vec<u8>>) -> serde_json::Result<Request<T>>
where for<'de> T: de::Deserialize<'de>,
{
let (parts, body) = req.into_parts();
let body = serde_json::from_slice(&body)?;
Ok(Request::from_parts(parts, body))
}
Or alternatively, serialize the body of a request to json
use http::Request;
use serde::ser;
fn serialize<T>(req: Request<T>) -> serde_json::Result<Request<Vec<u8>>>
where T: ser::Serialize,
{
let (parts, body) = req.into_parts();
let body = serde_json::to_vec(&body)?;
Ok(Request::from_parts(parts, body))
}
Implementations§
Source§impl Request<()>
impl Request<()>
Sourcepub fn builder() -> Builder
pub fn builder() -> Builder
Creates a new builder-style object to manufacture a Request
This method returns an instance of Builder
which can be used to
create a Request
.
§Examples
let request = Request::builder()
.method("GET")
.uri("https://www.rust-lang.org/")
.header("X-Custom-Foo", "Bar")
.body(())
.unwrap();
Sourcepub fn get<T>(uri: T) -> Builder
pub fn get<T>(uri: T) -> Builder
Creates a new Builder
initialized with a GET method and the given URI.
This method returns an instance of Builder
which can be used to
create a Request
.
§Example
let request = Request::get("https://www.rust-lang.org/")
.body(())
.unwrap();
Sourcepub fn put<T>(uri: T) -> Builder
pub fn put<T>(uri: T) -> Builder
Creates a new Builder
initialized with a PUT method and the given URI.
This method returns an instance of Builder
which can be used to
create a Request
.
§Example
let request = Request::put("https://www.rust-lang.org/")
.body(())
.unwrap();
Sourcepub fn post<T>(uri: T) -> Builder
pub fn post<T>(uri: T) -> Builder
Creates a new Builder
initialized with a POST method and the given URI.
This method returns an instance of Builder
which can be used to
create a Request
.
§Example
let request = Request::post("https://www.rust-lang.org/")
.body(())
.unwrap();
Sourcepub fn delete<T>(uri: T) -> Builder
pub fn delete<T>(uri: T) -> Builder
Creates a new Builder
initialized with a DELETE method and the given URI.
This method returns an instance of Builder
which can be used to
create a Request
.
§Example
let request = Request::delete("https://www.rust-lang.org/")
.body(())
.unwrap();
Sourcepub fn options<T>(uri: T) -> Builder
pub fn options<T>(uri: T) -> Builder
Creates a new Builder
initialized with an OPTIONS method and the given URI.
This method returns an instance of Builder
which can be used to
create a Request
.
§Example
let request = Request::options("https://www.rust-lang.org/")
.body(())
.unwrap();
Sourcepub fn head<T>(uri: T) -> Builder
pub fn head<T>(uri: T) -> Builder
Creates a new Builder
initialized with a HEAD method and the given URI.
This method returns an instance of Builder
which can be used to
create a Request
.
§Example
let request = Request::head("https://www.rust-lang.org/")
.body(())
.unwrap();
Sourcepub fn connect<T>(uri: T) -> Builder
pub fn connect<T>(uri: T) -> Builder
Creates a new Builder
initialized with a CONNECT method and the given URI.
This method returns an instance of Builder
which can be used to
create a Request
.
§Example
let request = Request::connect("https://www.rust-lang.org/")
.body(())
.unwrap();
Sourcepub fn patch<T>(uri: T) -> Builder
pub fn patch<T>(uri: T) -> Builder
Creates a new Builder
initialized with a PATCH method and the given URI.
This method returns an instance of Builder
which can be used to
create a Request
.
§Example
let request = Request::patch("https://www.rust-lang.org/")
.body(())
.unwrap();
Source§impl<T> Request<T>
impl<T> Request<T>
Sourcepub fn new(body: T) -> Request<T>
pub fn new(body: T) -> Request<T>
Creates a new blank Request
with the body
The component parts of this request will be set to their default, e.g. the GET method, no headers, etc.
§Examples
let request = Request::new("hello world");
assert_eq!(*request.method(), Method::GET);
assert_eq!(*request.body(), "hello world");
Sourcepub fn from_parts(parts: Parts, body: T) -> Request<T>
pub fn from_parts(parts: Parts, body: T) -> Request<T>
Creates a new Request
with the given components parts and body.
§Examples
let request = Request::new("hello world");
let (mut parts, body) = request.into_parts();
parts.method = Method::POST;
let request = Request::from_parts(parts, body);
Sourcepub fn method(&self) -> &Method
pub fn method(&self) -> &Method
Returns a reference to the associated HTTP method.
§Examples
let request: Request<()> = Request::default();
assert_eq!(*request.method(), Method::GET);
Sourcepub fn method_mut(&mut self) -> &mut Method
pub fn method_mut(&mut self) -> &mut Method
Returns a mutable reference to the associated HTTP method.
§Examples
let mut request: Request<()> = Request::default();
*request.method_mut() = Method::PUT;
assert_eq!(*request.method(), Method::PUT);
Sourcepub fn uri(&self) -> &Uri
pub fn uri(&self) -> &Uri
Returns a reference to the associated URI.
§Examples
let request: Request<()> = Request::default();
assert_eq!(*request.uri(), *"/");
Sourcepub fn uri_mut(&mut self) -> &mut Uri
pub fn uri_mut(&mut self) -> &mut Uri
Returns a mutable reference to the associated URI.
§Examples
let mut request: Request<()> = Request::default();
*request.uri_mut() = "/hello".parse().unwrap();
assert_eq!(*request.uri(), *"/hello");
Sourcepub fn version(&self) -> Version
pub fn version(&self) -> Version
Returns the associated version.
§Examples
let request: Request<()> = Request::default();
assert_eq!(request.version(), Version::HTTP_11);
Sourcepub fn version_mut(&mut self) -> &mut Version
pub fn version_mut(&mut self) -> &mut Version
Returns a mutable reference to the associated version.
§Examples
let mut request: Request<()> = Request::default();
*request.version_mut() = Version::HTTP_2;
assert_eq!(request.version(), Version::HTTP_2);
Sourcepub fn headers(&self) -> &HeaderMap
pub fn headers(&self) -> &HeaderMap
Returns a reference to the associated header field map.
§Examples
let request: Request<()> = Request::default();
assert!(request.headers().is_empty());
Sourcepub fn headers_mut(&mut self) -> &mut HeaderMap
pub fn headers_mut(&mut self) -> &mut HeaderMap
Returns a mutable reference to the associated header field map.
§Examples
let mut request: Request<()> = Request::default();
request.headers_mut().insert(HOST, HeaderValue::from_static("world"));
assert!(!request.headers().is_empty());
Sourcepub fn extensions(&self) -> &Extensions
pub fn extensions(&self) -> &Extensions
Returns a reference to the associated extensions.
§Examples
let request: Request<()> = Request::default();
assert!(request.extensions().get::<i32>().is_none());
Sourcepub fn extensions_mut(&mut self) -> &mut Extensions
pub fn extensions_mut(&mut self) -> &mut Extensions
Returns a mutable reference to the associated extensions.
§Examples
let mut request: Request<()> = Request::default();
request.extensions_mut().insert("hello");
assert_eq!(request.extensions().get(), Some(&"hello"));
Sourcepub fn body(&self) -> &T
pub fn body(&self) -> &T
Returns a reference to the associated HTTP body.
§Examples
let request: Request<String> = Request::default();
assert!(request.body().is_empty());
Sourcepub fn body_mut(&mut self) -> &mut T
pub fn body_mut(&mut self) -> &mut T
Returns a mutable reference to the associated HTTP body.
§Examples
let mut request: Request<String> = Request::default();
request.body_mut().push_str("hello world");
assert!(!request.body().is_empty());
Sourcepub fn into_body(self) -> T
pub fn into_body(self) -> T
Consumes the request, returning just the body.
§Examples
let request = Request::new(10);
let body = request.into_body();
assert_eq!(body, 10);
Sourcepub fn into_parts(self) -> (Parts, T)
pub fn into_parts(self) -> (Parts, T)
Consumes the request returning the head and body parts.
§Examples
let request = Request::new(());
let (parts, body) = request.into_parts();
assert_eq!(parts.method, Method::GET);
Sourcepub fn map<F, U>(self, f: F) -> Request<U>where
F: FnOnce(T) -> U,
pub fn map<F, U>(self, f: F) -> Request<U>where
F: FnOnce(T) -> U,
Consumes the request returning a new request with body mapped to the return type of the passed in function.
§Examples
let request = Request::builder().body("some string").unwrap();
let mapped_request: Request<&[u8]> = request.map(|b| {
assert_eq!(b, "some string");
b.as_bytes()
});
assert_eq!(mapped_request.body(), &"some string".as_bytes());
Trait Implementations§
Source§impl<B> Body for Request<B>where
B: Body,
impl<B> Body for Request<B>where
B: Body,
Source§fn poll_frame(
self: Pin<&mut Request<B>>,
cx: &mut Context<'_>,
) -> Poll<Option<Result<Frame<<Request<B> as Body>::Data>, <Request<B> as Body>::Error>>>
fn poll_frame( self: Pin<&mut Request<B>>, cx: &mut Context<'_>, ) -> Poll<Option<Result<Frame<<Request<B> as Body>::Data>, <Request<B> as Body>::Error>>>
Source§fn is_end_stream(&self) -> bool
fn is_end_stream(&self) -> bool
true
when the end of stream has been reached. Read moreSource§impl<Body> BodyExtractExt for Request<Body>
impl<Body> BodyExtractExt for Request<Body>
Source§async fn try_into_json<T>(self) -> Result<T, OpaqueError>where
T: DeserializeOwned + Send + 'static,
async fn try_into_json<T>(self) -> Result<T, OpaqueError>where
T: DeserializeOwned + Send + 'static,
Source§async fn try_into_string(self) -> Result<String, OpaqueError>
async fn try_into_string(self) -> Result<String, OpaqueError>
Source§impl<State, Body> Matcher<State, Request<Body>> for DomainMatcher
impl<State, Body> Matcher<State, Request<Body>> for DomainMatcher
Source§fn matches(
&self,
ext: Option<&mut Extensions>,
ctx: &Context<State>,
req: &Request<Body>,
) -> bool
fn matches( &self, ext: Option<&mut Extensions>, ctx: &Context<State>, req: &Request<Body>, ) -> bool
Source§fn or<M>(self, other: M) -> impl Matcher<State, Request>
fn or<M>(self, other: M) -> impl Matcher<State, Request>
Source§impl<State, Body> Matcher<State, Request<Body>> for HeaderMatcher
impl<State, Body> Matcher<State, Request<Body>> for HeaderMatcher
Source§fn matches(
&self,
_ext: Option<&mut Extensions>,
_ctx: &Context<State>,
req: &Request<Body>,
) -> bool
fn matches( &self, _ext: Option<&mut Extensions>, _ctx: &Context<State>, req: &Request<Body>, ) -> bool
Source§fn or<M>(self, other: M) -> impl Matcher<State, Request>
fn or<M>(self, other: M) -> impl Matcher<State, Request>
Source§impl<State, Body> Matcher<State, Request<Body>> for HttpMatcher<State, Body>
impl<State, Body> Matcher<State, Request<Body>> for HttpMatcher<State, Body>
Source§fn matches(
&self,
ext: Option<&mut Extensions>,
ctx: &Context<State>,
req: &Request<Body>,
) -> bool
fn matches( &self, ext: Option<&mut Extensions>, ctx: &Context<State>, req: &Request<Body>, ) -> bool
Source§fn or<M>(self, other: M) -> impl Matcher<State, Request>
fn or<M>(self, other: M) -> impl Matcher<State, Request>
Source§impl<State, Body> Matcher<State, Request<Body>> for HttpMatcherKind<State, Body>
impl<State, Body> Matcher<State, Request<Body>> for HttpMatcherKind<State, Body>
Source§fn matches(
&self,
ext: Option<&mut Extensions>,
ctx: &Context<State>,
req: &Request<Body>,
) -> bool
fn matches( &self, ext: Option<&mut Extensions>, ctx: &Context<State>, req: &Request<Body>, ) -> bool
Source§fn or<M>(self, other: M) -> impl Matcher<State, Request>
fn or<M>(self, other: M) -> impl Matcher<State, Request>
Source§impl<State, Body> Matcher<State, Request<Body>> for MethodMatcher
impl<State, Body> Matcher<State, Request<Body>> for MethodMatcher
Source§fn matches(
&self,
_ext: Option<&mut Extensions>,
_ctx: &Context<State>,
req: &Request<Body>,
) -> bool
fn matches( &self, _ext: Option<&mut Extensions>, _ctx: &Context<State>, req: &Request<Body>, ) -> bool
returns true on a match, false otherwise
Source§fn or<M>(self, other: M) -> impl Matcher<State, Request>
fn or<M>(self, other: M) -> impl Matcher<State, Request>
Source§impl<State, Body> Matcher<State, Request<Body>> for PathMatcher
impl<State, Body> Matcher<State, Request<Body>> for PathMatcher
Source§fn matches(
&self,
ext: Option<&mut Extensions>,
_ctx: &Context<State>,
req: &Request<Body>,
) -> bool
fn matches( &self, ext: Option<&mut Extensions>, _ctx: &Context<State>, req: &Request<Body>, ) -> bool
Source§fn or<M>(self, other: M) -> impl Matcher<State, Request>
fn or<M>(self, other: M) -> impl Matcher<State, Request>
Source§impl<State, Body> Matcher<State, Request<Body>> for UriMatcher
impl<State, Body> Matcher<State, Request<Body>> for UriMatcher
Source§fn matches(
&self,
_ext: Option<&mut Extensions>,
_ctx: &Context<State>,
req: &Request<Body>,
) -> bool
fn matches( &self, _ext: Option<&mut Extensions>, _ctx: &Context<State>, req: &Request<Body>, ) -> bool
Source§fn or<M>(self, other: M) -> impl Matcher<State, Request>
fn or<M>(self, other: M) -> impl Matcher<State, Request>
Source§impl<State, Body> Matcher<State, Request<Body>> for VersionMatcher
impl<State, Body> Matcher<State, Request<Body>> for VersionMatcher
Source§fn matches(
&self,
_ext: Option<&mut Extensions>,
_ctx: &Context<State>,
req: &Request<Body>,
) -> bool
fn matches( &self, _ext: Option<&mut Extensions>, _ctx: &Context<State>, req: &Request<Body>, ) -> bool
returns true on a match, false otherwise
Source§fn or<M>(self, other: M) -> impl Matcher<State, Request>
fn or<M>(self, other: M) -> impl Matcher<State, Request>
Source§impl<State, Body, S> Service<State, Request<Body>> for DnsResolveModeService<S>
impl<State, Body, S> Service<State, Request<Body>> for DnsResolveModeService<S>
Source§type Response = <S as Service<State, Request<Body>>>::Response
type Response = <S as Service<State, Request<Body>>>::Response
Source§type Error = OpaqueError
type Error = OpaqueError
Source§impl<S, State, Body> Service<State, Request<Body>> for ErrorHandler<S, ()>where
S: Service<State, Request<Body>, Response: IntoResponse, Error: IntoResponse>,
State: Clone + Send + Sync + 'static,
Body: Send + 'static,
impl<S, State, Body> Service<State, Request<Body>> for ErrorHandler<S, ()>where
S: Service<State, Request<Body>, Response: IntoResponse, Error: IntoResponse>,
State: Clone + Send + Sync + 'static,
Body: Send + 'static,
Source§impl<S, F, R, State, Body> Service<State, Request<Body>> for ErrorHandler<S, F>
impl<S, F, R, State, Body> Service<State, Request<Body>> for ErrorHandler<S, F>
Source§impl<T1, S, State, Body> Service<State, Request<Body>> for GetForwardedHeadersService<S, (T1,)>
impl<T1, S, State, Body> Service<State, Request<Body>> for GetForwardedHeadersService<S, (T1,)>
Source§type Response = <S as Service<State, Request<Body>>>::Response
type Response = <S as Service<State, Request<Body>>>::Response
Source§type Error = <S as Service<State, Request<Body>>>::Error
type Error = <S as Service<State, Request<Body>>>::Error
Source§impl<T1, T2, S, State, Body> Service<State, Request<Body>> for GetForwardedHeadersService<S, (T1, T2)>
impl<T1, T2, S, State, Body> Service<State, Request<Body>> for GetForwardedHeadersService<S, (T1, T2)>
Source§type Response = <S as Service<State, Request<Body>>>::Response
type Response = <S as Service<State, Request<Body>>>::Response
Source§type Error = <S as Service<State, Request<Body>>>::Error
type Error = <S as Service<State, Request<Body>>>::Error
Source§impl<T1, T2, T3, S, State, Body> Service<State, Request<Body>> for GetForwardedHeadersService<S, (T1, T2, T3)>where
T1: ForwardHeader + Send + Sync + 'static,
T2: ForwardHeader + Send + Sync + 'static,
T3: ForwardHeader + Send + Sync + 'static,
S: Service<State, Request<Body>>,
Body: Send + 'static,
State: Clone + Send + Sync + 'static,
impl<T1, T2, T3, S, State, Body> Service<State, Request<Body>> for GetForwardedHeadersService<S, (T1, T2, T3)>where
T1: ForwardHeader + Send + Sync + 'static,
T2: ForwardHeader + Send + Sync + 'static,
T3: ForwardHeader + Send + Sync + 'static,
S: Service<State, Request<Body>>,
Body: Send + 'static,
State: Clone + Send + Sync + 'static,
Source§type Response = <S as Service<State, Request<Body>>>::Response
type Response = <S as Service<State, Request<Body>>>::Response
Source§type Error = <S as Service<State, Request<Body>>>::Error
type Error = <S as Service<State, Request<Body>>>::Error
Source§impl<T1, T2, T3, T4, S, State, Body> Service<State, Request<Body>> for GetForwardedHeadersService<S, (T1, T2, T3, T4)>where
T1: ForwardHeader + Send + Sync + 'static,
T2: ForwardHeader + Send + Sync + 'static,
T3: ForwardHeader + Send + Sync + 'static,
T4: ForwardHeader + Send + Sync + 'static,
S: Service<State, Request<Body>>,
Body: Send + 'static,
State: Clone + Send + Sync + 'static,
impl<T1, T2, T3, T4, S, State, Body> Service<State, Request<Body>> for GetForwardedHeadersService<S, (T1, T2, T3, T4)>where
T1: ForwardHeader + Send + Sync + 'static,
T2: ForwardHeader + Send + Sync + 'static,
T3: ForwardHeader + Send + Sync + 'static,
T4: ForwardHeader + Send + Sync + 'static,
S: Service<State, Request<Body>>,
Body: Send + 'static,
State: Clone + Send + Sync + 'static,
Source§type Response = <S as Service<State, Request<Body>>>::Response
type Response = <S as Service<State, Request<Body>>>::Response
Source§type Error = <S as Service<State, Request<Body>>>::Error
type Error = <S as Service<State, Request<Body>>>::Error
Source§impl<T1, T2, T3, T4, T5, S, State, Body> Service<State, Request<Body>> for GetForwardedHeadersService<S, (T1, T2, T3, T4, T5)>where
T1: ForwardHeader + Send + Sync + 'static,
T2: ForwardHeader + Send + Sync + 'static,
T3: ForwardHeader + Send + Sync + 'static,
T4: ForwardHeader + Send + Sync + 'static,
T5: ForwardHeader + Send + Sync + 'static,
S: Service<State, Request<Body>>,
Body: Send + 'static,
State: Clone + Send + Sync + 'static,
impl<T1, T2, T3, T4, T5, S, State, Body> Service<State, Request<Body>> for GetForwardedHeadersService<S, (T1, T2, T3, T4, T5)>where
T1: ForwardHeader + Send + Sync + 'static,
T2: ForwardHeader + Send + Sync + 'static,
T3: ForwardHeader + Send + Sync + 'static,
T4: ForwardHeader + Send + Sync + 'static,
T5: ForwardHeader + Send + Sync + 'static,
S: Service<State, Request<Body>>,
Body: Send + 'static,
State: Clone + Send + Sync + 'static,
Source§type Response = <S as Service<State, Request<Body>>>::Response
type Response = <S as Service<State, Request<Body>>>::Response
Source§type Error = <S as Service<State, Request<Body>>>::Error
type Error = <S as Service<State, Request<Body>>>::Error
Source§impl<T1, T2, T3, T4, T5, T6, S, State, Body> Service<State, Request<Body>> for GetForwardedHeadersService<S, (T1, T2, T3, T4, T5, T6)>where
T1: ForwardHeader + Send + Sync + 'static,
T2: ForwardHeader + Send + Sync + 'static,
T3: ForwardHeader + Send + Sync + 'static,
T4: ForwardHeader + Send + Sync + 'static,
T5: ForwardHeader + Send + Sync + 'static,
T6: ForwardHeader + Send + Sync + 'static,
S: Service<State, Request<Body>>,
Body: Send + 'static,
State: Clone + Send + Sync + 'static,
impl<T1, T2, T3, T4, T5, T6, S, State, Body> Service<State, Request<Body>> for GetForwardedHeadersService<S, (T1, T2, T3, T4, T5, T6)>where
T1: ForwardHeader + Send + Sync + 'static,
T2: ForwardHeader + Send + Sync + 'static,
T3: ForwardHeader + Send + Sync + 'static,
T4: ForwardHeader + Send + Sync + 'static,
T5: ForwardHeader + Send + Sync + 'static,
T6: ForwardHeader + Send + Sync + 'static,
S: Service<State, Request<Body>>,
Body: Send + 'static,
State: Clone + Send + Sync + 'static,
Source§type Response = <S as Service<State, Request<Body>>>::Response
type Response = <S as Service<State, Request<Body>>>::Response
Source§type Error = <S as Service<State, Request<Body>>>::Error
type Error = <S as Service<State, Request<Body>>>::Error
Source§impl<T1, T2, T3, T4, T5, T6, T7, S, State, Body> Service<State, Request<Body>> for GetForwardedHeadersService<S, (T1, T2, T3, T4, T5, T6, T7)>where
T1: ForwardHeader + Send + Sync + 'static,
T2: ForwardHeader + Send + Sync + 'static,
T3: ForwardHeader + Send + Sync + 'static,
T4: ForwardHeader + Send + Sync + 'static,
T5: ForwardHeader + Send + Sync + 'static,
T6: ForwardHeader + Send + Sync + 'static,
T7: ForwardHeader + Send + Sync + 'static,
S: Service<State, Request<Body>>,
Body: Send + 'static,
State: Clone + Send + Sync + 'static,
impl<T1, T2, T3, T4, T5, T6, T7, S, State, Body> Service<State, Request<Body>> for GetForwardedHeadersService<S, (T1, T2, T3, T4, T5, T6, T7)>where
T1: ForwardHeader + Send + Sync + 'static,
T2: ForwardHeader + Send + Sync + 'static,
T3: ForwardHeader + Send + Sync + 'static,
T4: ForwardHeader + Send + Sync + 'static,
T5: ForwardHeader + Send + Sync + 'static,
T6: ForwardHeader + Send + Sync + 'static,
T7: ForwardHeader + Send + Sync + 'static,
S: Service<State, Request<Body>>,
Body: Send + 'static,
State: Clone + Send + Sync + 'static,
Source§type Response = <S as Service<State, Request<Body>>>::Response
type Response = <S as Service<State, Request<Body>>>::Response
Source§type Error = <S as Service<State, Request<Body>>>::Error
type Error = <S as Service<State, Request<Body>>>::Error
Source§impl<T1, T2, T3, T4, T5, T6, T7, T8, S, State, Body> Service<State, Request<Body>> for GetForwardedHeadersService<S, (T1, T2, T3, T4, T5, T6, T7, T8)>where
T1: ForwardHeader + Send + Sync + 'static,
T2: ForwardHeader + Send + Sync + 'static,
T3: ForwardHeader + Send + Sync + 'static,
T4: ForwardHeader + Send + Sync + 'static,
T5: ForwardHeader + Send + Sync + 'static,
T6: ForwardHeader + Send + Sync + 'static,
T7: ForwardHeader + Send + Sync + 'static,
T8: ForwardHeader + Send + Sync + 'static,
S: Service<State, Request<Body>>,
Body: Send + 'static,
State: Clone + Send + Sync + 'static,
impl<T1, T2, T3, T4, T5, T6, T7, T8, S, State, Body> Service<State, Request<Body>> for GetForwardedHeadersService<S, (T1, T2, T3, T4, T5, T6, T7, T8)>where
T1: ForwardHeader + Send + Sync + 'static,
T2: ForwardHeader + Send + Sync + 'static,
T3: ForwardHeader + Send + Sync + 'static,
T4: ForwardHeader + Send + Sync + 'static,
T5: ForwardHeader + Send + Sync + 'static,
T6: ForwardHeader + Send + Sync + 'static,
T7: ForwardHeader + Send + Sync + 'static,
T8: ForwardHeader + Send + Sync + 'static,
S: Service<State, Request<Body>>,
Body: Send + 'static,
State: Clone + Send + Sync + 'static,
Source§type Response = <S as Service<State, Request<Body>>>::Response
type Response = <S as Service<State, Request<Body>>>::Response
Source§type Error = <S as Service<State, Request<Body>>>::Error
type Error = <S as Service<State, Request<Body>>>::Error
Source§impl<T1, T2, T3, T4, T5, T6, T7, T8, T9, S, State, Body> Service<State, Request<Body>> for GetForwardedHeadersService<S, (T1, T2, T3, T4, T5, T6, T7, T8, T9)>where
T1: ForwardHeader + Send + Sync + 'static,
T2: ForwardHeader + Send + Sync + 'static,
T3: ForwardHeader + Send + Sync + 'static,
T4: ForwardHeader + Send + Sync + 'static,
T5: ForwardHeader + Send + Sync + 'static,
T6: ForwardHeader + Send + Sync + 'static,
T7: ForwardHeader + Send + Sync + 'static,
T8: ForwardHeader + Send + Sync + 'static,
T9: ForwardHeader + Send + Sync + 'static,
S: Service<State, Request<Body>>,
Body: Send + 'static,
State: Clone + Send + Sync + 'static,
impl<T1, T2, T3, T4, T5, T6, T7, T8, T9, S, State, Body> Service<State, Request<Body>> for GetForwardedHeadersService<S, (T1, T2, T3, T4, T5, T6, T7, T8, T9)>where
T1: ForwardHeader + Send + Sync + 'static,
T2: ForwardHeader + Send + Sync + 'static,
T3: ForwardHeader + Send + Sync + 'static,
T4: ForwardHeader + Send + Sync + 'static,
T5: ForwardHeader + Send + Sync + 'static,
T6: ForwardHeader + Send + Sync + 'static,
T7: ForwardHeader + Send + Sync + 'static,
T8: ForwardHeader + Send + Sync + 'static,
T9: ForwardHeader + Send + Sync + 'static,
S: Service<State, Request<Body>>,
Body: Send + 'static,
State: Clone + Send + Sync + 'static,
Source§type Response = <S as Service<State, Request<Body>>>::Response
type Response = <S as Service<State, Request<Body>>>::Response
Source§type Error = <S as Service<State, Request<Body>>>::Error
type Error = <S as Service<State, Request<Body>>>::Error
Source§impl<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, S, State, Body> Service<State, Request<Body>> for GetForwardedHeadersService<S, (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)>where
T1: ForwardHeader + Send + Sync + 'static,
T2: ForwardHeader + Send + Sync + 'static,
T3: ForwardHeader + Send + Sync + 'static,
T4: ForwardHeader + Send + Sync + 'static,
T5: ForwardHeader + Send + Sync + 'static,
T6: ForwardHeader + Send + Sync + 'static,
T7: ForwardHeader + Send + Sync + 'static,
T8: ForwardHeader + Send + Sync + 'static,
T9: ForwardHeader + Send + Sync + 'static,
T10: ForwardHeader + Send + Sync + 'static,
S: Service<State, Request<Body>>,
Body: Send + 'static,
State: Clone + Send + Sync + 'static,
impl<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, S, State, Body> Service<State, Request<Body>> for GetForwardedHeadersService<S, (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)>where
T1: ForwardHeader + Send + Sync + 'static,
T2: ForwardHeader + Send + Sync + 'static,
T3: ForwardHeader + Send + Sync + 'static,
T4: ForwardHeader + Send + Sync + 'static,
T5: ForwardHeader + Send + Sync + 'static,
T6: ForwardHeader + Send + Sync + 'static,
T7: ForwardHeader + Send + Sync + 'static,
T8: ForwardHeader + Send + Sync + 'static,
T9: ForwardHeader + Send + Sync + 'static,
T10: ForwardHeader + Send + Sync + 'static,
S: Service<State, Request<Body>>,
Body: Send + 'static,
State: Clone + Send + Sync + 'static,
Source§type Response = <S as Service<State, Request<Body>>>::Response
type Response = <S as Service<State, Request<Body>>>::Response
Source§type Error = <S as Service<State, Request<Body>>>::Error
type Error = <S as Service<State, Request<Body>>>::Error
Source§impl<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, S, State, Body> Service<State, Request<Body>> for GetForwardedHeadersService<S, (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)>where
T1: ForwardHeader + Send + Sync + 'static,
T2: ForwardHeader + Send + Sync + 'static,
T3: ForwardHeader + Send + Sync + 'static,
T4: ForwardHeader + Send + Sync + 'static,
T5: ForwardHeader + Send + Sync + 'static,
T6: ForwardHeader + Send + Sync + 'static,
T7: ForwardHeader + Send + Sync + 'static,
T8: ForwardHeader + Send + Sync + 'static,
T9: ForwardHeader + Send + Sync + 'static,
T10: ForwardHeader + Send + Sync + 'static,
T11: ForwardHeader + Send + Sync + 'static,
S: Service<State, Request<Body>>,
Body: Send + 'static,
State: Clone + Send + Sync + 'static,
impl<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, S, State, Body> Service<State, Request<Body>> for GetForwardedHeadersService<S, (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)>where
T1: ForwardHeader + Send + Sync + 'static,
T2: ForwardHeader + Send + Sync + 'static,
T3: ForwardHeader + Send + Sync + 'static,
T4: ForwardHeader + Send + Sync + 'static,
T5: ForwardHeader + Send + Sync + 'static,
T6: ForwardHeader + Send + Sync + 'static,
T7: ForwardHeader + Send + Sync + 'static,
T8: ForwardHeader + Send + Sync + 'static,
T9: ForwardHeader + Send + Sync + 'static,
T10: ForwardHeader + Send + Sync + 'static,
T11: ForwardHeader + Send + Sync + 'static,
S: Service<State, Request<Body>>,
Body: Send + 'static,
State: Clone + Send + Sync + 'static,
Source§type Response = <S as Service<State, Request<Body>>>::Response
type Response = <S as Service<State, Request<Body>>>::Response
Source§type Error = <S as Service<State, Request<Body>>>::Error
type Error = <S as Service<State, Request<Body>>>::Error
Source§impl<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, S, State, Body> Service<State, Request<Body>> for GetForwardedHeadersService<S, (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12)>where
T1: ForwardHeader + Send + Sync + 'static,
T2: ForwardHeader + Send + Sync + 'static,
T3: ForwardHeader + Send + Sync + 'static,
T4: ForwardHeader + Send + Sync + 'static,
T5: ForwardHeader + Send + Sync + 'static,
T6: ForwardHeader + Send + Sync + 'static,
T7: ForwardHeader + Send + Sync + 'static,
T8: ForwardHeader + Send + Sync + 'static,
T9: ForwardHeader + Send + Sync + 'static,
T10: ForwardHeader + Send + Sync + 'static,
T11: ForwardHeader + Send + Sync + 'static,
T12: ForwardHeader + Send + Sync + 'static,
S: Service<State, Request<Body>>,
Body: Send + 'static,
State: Clone + Send + Sync + 'static,
impl<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, S, State, Body> Service<State, Request<Body>> for GetForwardedHeadersService<S, (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12)>where
T1: ForwardHeader + Send + Sync + 'static,
T2: ForwardHeader + Send + Sync + 'static,
T3: ForwardHeader + Send + Sync + 'static,
T4: ForwardHeader + Send + Sync + 'static,
T5: ForwardHeader + Send + Sync + 'static,
T6: ForwardHeader + Send + Sync + 'static,
T7: ForwardHeader + Send + Sync + 'static,
T8: ForwardHeader + Send + Sync + 'static,
T9: ForwardHeader + Send + Sync + 'static,
T10: ForwardHeader + Send + Sync + 'static,
T11: ForwardHeader + Send + Sync + 'static,
T12: ForwardHeader + Send + Sync + 'static,
S: Service<State, Request<Body>>,
Body: Send + 'static,
State: Clone + Send + Sync + 'static,
Source§type Response = <S as Service<State, Request<Body>>>::Response
type Response = <S as Service<State, Request<Body>>>::Response
Source§type Error = <S as Service<State, Request<Body>>>::Error
type Error = <S as Service<State, Request<Body>>>::Error
Source§impl<H, S, State, Body> Service<State, Request<Body>> for GetForwardedHeadersService<S, H>
impl<H, S, State, Body> Service<State, Request<Body>> for GetForwardedHeadersService<S, H>
Source§type Response = <S as Service<State, Request<Body>>>::Response
type Response = <S as Service<State, Request<Body>>>::Response
Source§type Error = <S as Service<State, Request<Body>>>::Error
type Error = <S as Service<State, Request<Body>>>::Error
Source§impl<T, S, State, Body, E> Service<State, Request<Body>> for HeaderConfigService<T, S>
impl<T, S, State, Body, E> Service<State, Request<Body>> for HeaderConfigService<T, S>
Source§type Response = <S as Service<State, Request<Body>>>::Response
type Response = <S as Service<State, Request<Body>>>::Response
Source§impl<T, S, State, Body, E> Service<State, Request<Body>> for HeaderOptionValueService<T, S>
impl<T, S, State, Body, E> Service<State, Request<Body>> for HeaderOptionValueService<T, S>
Source§type Response = <S as Service<State, Request<Body>>>::Response
type Response = <S as Service<State, Request<Body>>>::Response
Source§impl<State, Body, ResBody> Service<State, Request<Body>> for Redirect<ResBody>
impl<State, Body, ResBody> Service<State, Request<Body>> for Redirect<ResBody>
Source§impl<S, F, State, Body> Service<State, Request<Body>> for RequestMetricsService<S, F>where
S: Service<State, Request<Body>, Response: IntoResponse>,
F: AttributesFactory<State>,
State: Clone + Send + Sync + 'static,
Body: Send + 'static,
Available on crate feature telemetry
only.
impl<S, F, State, Body> Service<State, Request<Body>> for RequestMetricsService<S, F>where
S: Service<State, Request<Body>, Response: IntoResponse>,
F: AttributesFactory<State>,
State: Clone + Send + Sync + 'static,
Body: Send + 'static,
telemetry
only.Source§impl<P, S, State, Body> Service<State, Request<Body>> for Retry<P, S>
impl<P, S, State, Body> Service<State, Request<Body>> for Retry<P, S>
Source§type Response = <S as Service<State, Request<RetryBody>>>::Response
type Response = <S as Service<State, Request<RetryBody>>>::Response
Source§type Error = RetryError
type Error = RetryError
Source§impl<S, T1, State, Body> Service<State, Request<Body>> for SetForwardedHeadersService<S, (T1,)>
impl<S, T1, State, Body> Service<State, Request<Body>> for SetForwardedHeadersService<S, (T1,)>
Source§impl<S, T1, T2, State, Body> Service<State, Request<Body>> for SetForwardedHeadersService<S, (T1, T2)>
impl<S, T1, T2, State, Body> Service<State, Request<Body>> for SetForwardedHeadersService<S, (T1, T2)>
Source§impl<S, T1, T2, T3, State, Body> Service<State, Request<Body>> for SetForwardedHeadersService<S, (T1, T2, T3)>
impl<S, T1, T2, T3, State, Body> Service<State, Request<Body>> for SetForwardedHeadersService<S, (T1, T2, T3)>
Source§impl<S, T1, T2, T3, T4, State, Body> Service<State, Request<Body>> for SetForwardedHeadersService<S, (T1, T2, T3, T4)>where
T1: ForwardHeader + Send + Sync + 'static,
T2: ForwardHeader + Send + Sync + 'static,
T3: ForwardHeader + Send + Sync + 'static,
T4: ForwardHeader + Send + Sync + 'static,
S: Service<State, Request<Body>, Error: Into<BoxError>>,
Body: Send + 'static,
State: Clone + Send + Sync + 'static,
impl<S, T1, T2, T3, T4, State, Body> Service<State, Request<Body>> for SetForwardedHeadersService<S, (T1, T2, T3, T4)>where
T1: ForwardHeader + Send + Sync + 'static,
T2: ForwardHeader + Send + Sync + 'static,
T3: ForwardHeader + Send + Sync + 'static,
T4: ForwardHeader + Send + Sync + 'static,
S: Service<State, Request<Body>, Error: Into<BoxError>>,
Body: Send + 'static,
State: Clone + Send + Sync + 'static,
Source§impl<S, T1, T2, T3, T4, T5, State, Body> Service<State, Request<Body>> for SetForwardedHeadersService<S, (T1, T2, T3, T4, T5)>where
T1: ForwardHeader + Send + Sync + 'static,
T2: ForwardHeader + Send + Sync + 'static,
T3: ForwardHeader + Send + Sync + 'static,
T4: ForwardHeader + Send + Sync + 'static,
T5: ForwardHeader + Send + Sync + 'static,
S: Service<State, Request<Body>, Error: Into<BoxError>>,
Body: Send + 'static,
State: Clone + Send + Sync + 'static,
impl<S, T1, T2, T3, T4, T5, State, Body> Service<State, Request<Body>> for SetForwardedHeadersService<S, (T1, T2, T3, T4, T5)>where
T1: ForwardHeader + Send + Sync + 'static,
T2: ForwardHeader + Send + Sync + 'static,
T3: ForwardHeader + Send + Sync + 'static,
T4: ForwardHeader + Send + Sync + 'static,
T5: ForwardHeader + Send + Sync + 'static,
S: Service<State, Request<Body>, Error: Into<BoxError>>,
Body: Send + 'static,
State: Clone + Send + Sync + 'static,
Source§impl<S, T1, T2, T3, T4, T5, T6, State, Body> Service<State, Request<Body>> for SetForwardedHeadersService<S, (T1, T2, T3, T4, T5, T6)>where
T1: ForwardHeader + Send + Sync + 'static,
T2: ForwardHeader + Send + Sync + 'static,
T3: ForwardHeader + Send + Sync + 'static,
T4: ForwardHeader + Send + Sync + 'static,
T5: ForwardHeader + Send + Sync + 'static,
T6: ForwardHeader + Send + Sync + 'static,
S: Service<State, Request<Body>, Error: Into<BoxError>>,
Body: Send + 'static,
State: Clone + Send + Sync + 'static,
impl<S, T1, T2, T3, T4, T5, T6, State, Body> Service<State, Request<Body>> for SetForwardedHeadersService<S, (T1, T2, T3, T4, T5, T6)>where
T1: ForwardHeader + Send + Sync + 'static,
T2: ForwardHeader + Send + Sync + 'static,
T3: ForwardHeader + Send + Sync + 'static,
T4: ForwardHeader + Send + Sync + 'static,
T5: ForwardHeader + Send + Sync + 'static,
T6: ForwardHeader + Send + Sync + 'static,
S: Service<State, Request<Body>, Error: Into<BoxError>>,
Body: Send + 'static,
State: Clone + Send + Sync + 'static,
Source§impl<S, T1, T2, T3, T4, T5, T6, T7, State, Body> Service<State, Request<Body>> for SetForwardedHeadersService<S, (T1, T2, T3, T4, T5, T6, T7)>where
T1: ForwardHeader + Send + Sync + 'static,
T2: ForwardHeader + Send + Sync + 'static,
T3: ForwardHeader + Send + Sync + 'static,
T4: ForwardHeader + Send + Sync + 'static,
T5: ForwardHeader + Send + Sync + 'static,
T6: ForwardHeader + Send + Sync + 'static,
T7: ForwardHeader + Send + Sync + 'static,
S: Service<State, Request<Body>, Error: Into<BoxError>>,
Body: Send + 'static,
State: Clone + Send + Sync + 'static,
impl<S, T1, T2, T3, T4, T5, T6, T7, State, Body> Service<State, Request<Body>> for SetForwardedHeadersService<S, (T1, T2, T3, T4, T5, T6, T7)>where
T1: ForwardHeader + Send + Sync + 'static,
T2: ForwardHeader + Send + Sync + 'static,
T3: ForwardHeader + Send + Sync + 'static,
T4: ForwardHeader + Send + Sync + 'static,
T5: ForwardHeader + Send + Sync + 'static,
T6: ForwardHeader + Send + Sync + 'static,
T7: ForwardHeader + Send + Sync + 'static,
S: Service<State, Request<Body>, Error: Into<BoxError>>,
Body: Send + 'static,
State: Clone + Send + Sync + 'static,
Source§impl<S, T1, T2, T3, T4, T5, T6, T7, T8, State, Body> Service<State, Request<Body>> for SetForwardedHeadersService<S, (T1, T2, T3, T4, T5, T6, T7, T8)>where
T1: ForwardHeader + Send + Sync + 'static,
T2: ForwardHeader + Send + Sync + 'static,
T3: ForwardHeader + Send + Sync + 'static,
T4: ForwardHeader + Send + Sync + 'static,
T5: ForwardHeader + Send + Sync + 'static,
T6: ForwardHeader + Send + Sync + 'static,
T7: ForwardHeader + Send + Sync + 'static,
T8: ForwardHeader + Send + Sync + 'static,
S: Service<State, Request<Body>, Error: Into<BoxError>>,
Body: Send + 'static,
State: Clone + Send + Sync + 'static,
impl<S, T1, T2, T3, T4, T5, T6, T7, T8, State, Body> Service<State, Request<Body>> for SetForwardedHeadersService<S, (T1, T2, T3, T4, T5, T6, T7, T8)>where
T1: ForwardHeader + Send + Sync + 'static,
T2: ForwardHeader + Send + Sync + 'static,
T3: ForwardHeader + Send + Sync + 'static,
T4: ForwardHeader + Send + Sync + 'static,
T5: ForwardHeader + Send + Sync + 'static,
T6: ForwardHeader + Send + Sync + 'static,
T7: ForwardHeader + Send + Sync + 'static,
T8: ForwardHeader + Send + Sync + 'static,
S: Service<State, Request<Body>, Error: Into<BoxError>>,
Body: Send + 'static,
State: Clone + Send + Sync + 'static,
Source§impl<S, T1, T2, T3, T4, T5, T6, T7, T8, T9, State, Body> Service<State, Request<Body>> for SetForwardedHeadersService<S, (T1, T2, T3, T4, T5, T6, T7, T8, T9)>where
T1: ForwardHeader + Send + Sync + 'static,
T2: ForwardHeader + Send + Sync + 'static,
T3: ForwardHeader + Send + Sync + 'static,
T4: ForwardHeader + Send + Sync + 'static,
T5: ForwardHeader + Send + Sync + 'static,
T6: ForwardHeader + Send + Sync + 'static,
T7: ForwardHeader + Send + Sync + 'static,
T8: ForwardHeader + Send + Sync + 'static,
T9: ForwardHeader + Send + Sync + 'static,
S: Service<State, Request<Body>, Error: Into<BoxError>>,
Body: Send + 'static,
State: Clone + Send + Sync + 'static,
impl<S, T1, T2, T3, T4, T5, T6, T7, T8, T9, State, Body> Service<State, Request<Body>> for SetForwardedHeadersService<S, (T1, T2, T3, T4, T5, T6, T7, T8, T9)>where
T1: ForwardHeader + Send + Sync + 'static,
T2: ForwardHeader + Send + Sync + 'static,
T3: ForwardHeader + Send + Sync + 'static,
T4: ForwardHeader + Send + Sync + 'static,
T5: ForwardHeader + Send + Sync + 'static,
T6: ForwardHeader + Send + Sync + 'static,
T7: ForwardHeader + Send + Sync + 'static,
T8: ForwardHeader + Send + Sync + 'static,
T9: ForwardHeader + Send + Sync + 'static,
S: Service<State, Request<Body>, Error: Into<BoxError>>,
Body: Send + 'static,
State: Clone + Send + Sync + 'static,
Source§impl<S, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, State, Body> Service<State, Request<Body>> for SetForwardedHeadersService<S, (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)>where
T1: ForwardHeader + Send + Sync + 'static,
T2: ForwardHeader + Send + Sync + 'static,
T3: ForwardHeader + Send + Sync + 'static,
T4: ForwardHeader + Send + Sync + 'static,
T5: ForwardHeader + Send + Sync + 'static,
T6: ForwardHeader + Send + Sync + 'static,
T7: ForwardHeader + Send + Sync + 'static,
T8: ForwardHeader + Send + Sync + 'static,
T9: ForwardHeader + Send + Sync + 'static,
T10: ForwardHeader + Send + Sync + 'static,
S: Service<State, Request<Body>, Error: Into<BoxError>>,
Body: Send + 'static,
State: Clone + Send + Sync + 'static,
impl<S, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, State, Body> Service<State, Request<Body>> for SetForwardedHeadersService<S, (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)>where
T1: ForwardHeader + Send + Sync + 'static,
T2: ForwardHeader + Send + Sync + 'static,
T3: ForwardHeader + Send + Sync + 'static,
T4: ForwardHeader + Send + Sync + 'static,
T5: ForwardHeader + Send + Sync + 'static,
T6: ForwardHeader + Send + Sync + 'static,
T7: ForwardHeader + Send + Sync + 'static,
T8: ForwardHeader + Send + Sync + 'static,
T9: ForwardHeader + Send + Sync + 'static,
T10: ForwardHeader + Send + Sync + 'static,
S: Service<State, Request<Body>, Error: Into<BoxError>>,
Body: Send + 'static,
State: Clone + Send + Sync + 'static,
Source§impl<S, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, State, Body> Service<State, Request<Body>> for SetForwardedHeadersService<S, (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)>where
T1: ForwardHeader + Send + Sync + 'static,
T2: ForwardHeader + Send + Sync + 'static,
T3: ForwardHeader + Send + Sync + 'static,
T4: ForwardHeader + Send + Sync + 'static,
T5: ForwardHeader + Send + Sync + 'static,
T6: ForwardHeader + Send + Sync + 'static,
T7: ForwardHeader + Send + Sync + 'static,
T8: ForwardHeader + Send + Sync + 'static,
T9: ForwardHeader + Send + Sync + 'static,
T10: ForwardHeader + Send + Sync + 'static,
T11: ForwardHeader + Send + Sync + 'static,
S: Service<State, Request<Body>, Error: Into<BoxError>>,
Body: Send + 'static,
State: Clone + Send + Sync + 'static,
impl<S, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, State, Body> Service<State, Request<Body>> for SetForwardedHeadersService<S, (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)>where
T1: ForwardHeader + Send + Sync + 'static,
T2: ForwardHeader + Send + Sync + 'static,
T3: ForwardHeader + Send + Sync + 'static,
T4: ForwardHeader + Send + Sync + 'static,
T5: ForwardHeader + Send + Sync + 'static,
T6: ForwardHeader + Send + Sync + 'static,
T7: ForwardHeader + Send + Sync + 'static,
T8: ForwardHeader + Send + Sync + 'static,
T9: ForwardHeader + Send + Sync + 'static,
T10: ForwardHeader + Send + Sync + 'static,
T11: ForwardHeader + Send + Sync + 'static,
S: Service<State, Request<Body>, Error: Into<BoxError>>,
Body: Send + 'static,
State: Clone + Send + Sync + 'static,
Source§impl<S, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, State, Body> Service<State, Request<Body>> for SetForwardedHeadersService<S, (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12)>where
T1: ForwardHeader + Send + Sync + 'static,
T2: ForwardHeader + Send + Sync + 'static,
T3: ForwardHeader + Send + Sync + 'static,
T4: ForwardHeader + Send + Sync + 'static,
T5: ForwardHeader + Send + Sync + 'static,
T6: ForwardHeader + Send + Sync + 'static,
T7: ForwardHeader + Send + Sync + 'static,
T8: ForwardHeader + Send + Sync + 'static,
T9: ForwardHeader + Send + Sync + 'static,
T10: ForwardHeader + Send + Sync + 'static,
T11: ForwardHeader + Send + Sync + 'static,
T12: ForwardHeader + Send + Sync + 'static,
S: Service<State, Request<Body>, Error: Into<BoxError>>,
Body: Send + 'static,
State: Clone + Send + Sync + 'static,
impl<S, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, State, Body> Service<State, Request<Body>> for SetForwardedHeadersService<S, (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12)>where
T1: ForwardHeader + Send + Sync + 'static,
T2: ForwardHeader + Send + Sync + 'static,
T3: ForwardHeader + Send + Sync + 'static,
T4: ForwardHeader + Send + Sync + 'static,
T5: ForwardHeader + Send + Sync + 'static,
T6: ForwardHeader + Send + Sync + 'static,
T7: ForwardHeader + Send + Sync + 'static,
T8: ForwardHeader + Send + Sync + 'static,
T9: ForwardHeader + Send + Sync + 'static,
T10: ForwardHeader + Send + Sync + 'static,
T11: ForwardHeader + Send + Sync + 'static,
T12: ForwardHeader + Send + Sync + 'static,
S: Service<State, Request<Body>, Error: Into<BoxError>>,
Body: Send + 'static,
State: Clone + Send + Sync + 'static,
Source§impl<S, H, State, Body> Service<State, Request<Body>> for SetForwardedHeadersService<S, H>
impl<S, H, State, Body> Service<State, Request<Body>> for SetForwardedHeadersService<S, H>
Source§impl<S, State, Body> Service<State, Request<Body>> for UserAgentClassifier<S>
impl<S, State, Body> Service<State, Request<Body>> for UserAgentClassifier<S>
Source§type Response = <S as Service<State, Request<Body>>>::Response
type Response = <S as Service<State, Request<Body>>>::Response
Source§type Error = <S as Service<State, Request<Body>>>::Error
type Error = <S as Service<State, Request<Body>>>::Error
Source§impl<State> Service<State, Request<Body>> for WebService<State>
impl<State> Service<State, Request<Body>> for WebService<State>
Source§impl<S, State, ReqBody, ResBody> Service<State, Request<ReqBody>> for AddAuthorization<S>
impl<S, State, ReqBody, ResBody> Service<State, Request<ReqBody>> for AddAuthorization<S>
Source§type Response = <S as Service<State, Request<ReqBody>>>::Response
type Response = <S as Service<State, Request<ReqBody>>>::Response
Source§type Error = <S as Service<State, Request<ReqBody>>>::Error
type Error = <S as Service<State, Request<ReqBody>>>::Error
Source§impl<ReqBody, ResBody, State, S> Service<State, Request<ReqBody>> for AddRequiredRequestHeaders<S>
impl<ReqBody, ResBody, State, S> Service<State, Request<ReqBody>> for AddRequiredRequestHeaders<S>
Source§type Response = <S as Service<State, Request<ReqBody>>>::Response
type Response = <S as Service<State, Request<ReqBody>>>::Response
Source§impl<ReqBody, ResBody, State, S> Service<State, Request<ReqBody>> for AddRequiredResponseHeaders<S>
impl<ReqBody, ResBody, State, S> Service<State, Request<ReqBody>> for AddRequiredResponseHeaders<S>
Source§type Response = <S as Service<State, Request<ReqBody>>>::Response
type Response = <S as Service<State, Request<ReqBody>>>::Response
Source§type Error = <S as Service<State, Request<ReqBody>>>::Error
type Error = <S as Service<State, Request<ReqBody>>>::Error
Source§impl<ReqBody, ResBody, S, State, Auth> Service<State, Request<ReqBody>> for AsyncRequireAuthorization<S, Auth>
impl<ReqBody, ResBody, S, State, Auth> Service<State, Request<ReqBody>> for AsyncRequireAuthorization<S, Auth>
Source§type Error = <S as Service<State, Request<<Auth as AsyncAuthorizeRequest<State, ReqBody>>::RequestBody>>>::Error
type Error = <S as Service<State, Request<<Auth as AsyncAuthorizeRequest<State, ReqBody>>::RequestBody>>>::Error
Source§impl<S, State, ReqBody> Service<State, Request<ReqBody>> for BodyLimitService<S>
impl<S, State, ReqBody> Service<State, Request<ReqBody>> for BodyLimitService<S>
Source§type Response = <S as Service<State, Request<Body>>>::Response
type Response = <S as Service<State, Request<Body>>>::Response
Source§type Error = <S as Service<State, Request<Body>>>::Error
type Error = <S as Service<State, Request<Body>>>::Error
Source§impl<State, S, T, ReqBody, ResBody> Service<State, Request<ReqBody>> for CatchPanic<S, T>
impl<State, S, T, ReqBody, ResBody> Service<State, Request<ReqBody>> for CatchPanic<S, T>
Source§impl<S, State, ReqBody, ResBody> Service<State, Request<ReqBody>> for CollectBody<S>
impl<S, State, ReqBody, ResBody> Service<State, Request<ReqBody>> for CollectBody<S>
Source§impl<ReqBody, ResBody, S, P, State> Service<State, Request<ReqBody>> for Compression<S, P>
Available on crate feature compression
only.
impl<ReqBody, ResBody, S, P, State> Service<State, Request<ReqBody>> for Compression<S, P>
compression
only.Source§type Response = Response<CompressionBody<ResBody>>
type Response = Response<CompressionBody<ResBody>>
Source§type Error = <S as Service<State, Request<ReqBody>>>::Error
type Error = <S as Service<State, Request<ReqBody>>>::Error
Source§impl<S, State, ReqBody, ResBody> Service<State, Request<ReqBody>> for Cors<S>
impl<S, State, ReqBody, ResBody> Service<State, Request<ReqBody>> for Cors<S>
Source§type Response = <S as Service<State, Request<ReqBody>>>::Response
type Response = <S as Service<State, Request<ReqBody>>>::Response
Source§type Error = <S as Service<State, Request<ReqBody>>>::Error
type Error = <S as Service<State, Request<ReqBody>>>::Error
Source§impl<S, State, ReqBody, ResBody> Service<State, Request<ReqBody>> for Decompression<S>
Available on crate feature compression
only.
impl<S, State, ReqBody, ResBody> Service<State, Request<ReqBody>> for Decompression<S>
compression
only.Source§type Response = Response<DecompressionBody<ResBody>>
type Response = Response<DecompressionBody<ResBody>>
Source§type Error = <S as Service<State, Request<ReqBody>>>::Error
type Error = <S as Service<State, Request<ReqBody>>>::Error
Source§impl<State, ReqBody> Service<State, Request<ReqBody>> for DefaultServeDirFallback
impl<State, ReqBody> Service<State, Request<ReqBody>> for DefaultServeDirFallback
Source§impl<State, ReqBody, ResBody, S, P> Service<State, Request<ReqBody>> for FollowRedirect<S, P>
impl<State, ReqBody, ResBody, S, P> Service<State, Request<ReqBody>> for FollowRedirect<S, P>
Source§type Error = <S as Service<State, Request<ReqBody>>>::Error
type Error = <S as Service<State, Request<ReqBody>>>::Error
Source§impl<F, S, State, ReqBody, ResBody, NewReqBody> Service<State, Request<ReqBody>> for MapRequestBody<S, F>
impl<F, S, State, ReqBody, ResBody, NewReqBody> Service<State, Request<ReqBody>> for MapRequestBody<S, F>
Source§type Response = <S as Service<State, Request<NewReqBody>>>::Response
type Response = <S as Service<State, Request<NewReqBody>>>::Response
Source§type Error = <S as Service<State, Request<NewReqBody>>>::Error
type Error = <S as Service<State, Request<NewReqBody>>>::Error
Source§impl<F, S, State, ReqBody, ResBody, NewResBody> Service<State, Request<ReqBody>> for MapResponseBody<S, F>
impl<F, S, State, ReqBody, ResBody, NewResBody> Service<State, Request<ReqBody>> for MapResponseBody<S, F>
Source§impl<S, State, ReqBody, ResBody> Service<State, Request<ReqBody>> for NormalizePath<S>
impl<S, State, ReqBody, ResBody> Service<State, Request<ReqBody>> for NormalizePath<S>
Source§type Response = <S as Service<State, Request<ReqBody>>>::Response
type Response = <S as Service<State, Request<ReqBody>>>::Response
Source§type Error = <S as Service<State, Request<ReqBody>>>::Error
type Error = <S as Service<State, Request<ReqBody>>>::Error
Source§impl<ReqBody, ResBody, S, State> Service<State, Request<ReqBody>> for PropagateHeader<S>
impl<ReqBody, ResBody, S, State> Service<State, Request<ReqBody>> for PropagateHeader<S>
Source§type Response = <S as Service<State, Request<ReqBody>>>::Response
type Response = <S as Service<State, Request<ReqBody>>>::Response
Source§type Error = <S as Service<State, Request<ReqBody>>>::Error
type Error = <S as Service<State, Request<ReqBody>>>::Error
Source§impl<State, S, ReqBody, ResBody> Service<State, Request<ReqBody>> for PropagateRequestId<S>
impl<State, S, ReqBody, ResBody> Service<State, Request<ReqBody>> for PropagateRequestId<S>
Source§type Response = <S as Service<State, Request<ReqBody>>>::Response
type Response = <S as Service<State, Request<ReqBody>>>::Response
Source§type Error = <S as Service<State, Request<ReqBody>>>::Error
type Error = <S as Service<State, Request<ReqBody>>>::Error
Source§impl<A, C, L, S, State, ReqBody, ResBody> Service<State, Request<ReqBody>> for ProxyAuthService<A, C, S, L>
impl<A, C, L, S, State, ReqBody, ResBody> Service<State, Request<ReqBody>> for ProxyAuthService<A, C, S, L>
Source§type Response = <S as Service<State, Request<ReqBody>>>::Response
type Response = <S as Service<State, Request<ReqBody>>>::Response
Source§type Error = <S as Service<State, Request<ReqBody>>>::Error
type Error = <S as Service<State, Request<ReqBody>>>::Error
Source§impl<ReqBody, ResBody, State, S> Service<State, Request<ReqBody>> for RemoveRequestHeader<S>
impl<ReqBody, ResBody, State, S> Service<State, Request<ReqBody>> for RemoveRequestHeader<S>
Source§type Response = <S as Service<State, Request<ReqBody>>>::Response
type Response = <S as Service<State, Request<ReqBody>>>::Response
Source§type Error = <S as Service<State, Request<ReqBody>>>::Error
type Error = <S as Service<State, Request<ReqBody>>>::Error
Source§impl<ReqBody, ResBody, State, S> Service<State, Request<ReqBody>> for RemoveResponseHeader<S>
impl<ReqBody, ResBody, State, S> Service<State, Request<ReqBody>> for RemoveResponseHeader<S>
Source§type Response = <S as Service<State, Request<ReqBody>>>::Response
type Response = <S as Service<State, Request<ReqBody>>>::Response
Source§type Error = <S as Service<State, Request<ReqBody>>>::Error
type Error = <S as Service<State, Request<ReqBody>>>::Error
Source§impl<S, State, ReqBody, ResBody, D> Service<State, Request<ReqBody>> for RequestDecompression<S>
Available on crate feature compression
only.
impl<S, State, ReqBody, ResBody, D> Service<State, Request<ReqBody>> for RequestDecompression<S>
compression
only.Source§type Response = Response<UnsyncBoxBody<D, Box<dyn Error + Send + Sync>>>
type Response = Response<UnsyncBoxBody<D, Box<dyn Error + Send + Sync>>>
Source§impl<State, S, W, ReqBody, ResBody> Service<State, Request<ReqBody>> for RequestWriterService<S, W>
impl<State, S, W, ReqBody, ResBody> Service<State, Request<ReqBody>> for RequestWriterService<S, W>
Source§impl<State, S, W, ReqBody, ResBody> Service<State, Request<ReqBody>> for ResponseWriterService<S, W>
impl<State, S, W, ReqBody, ResBody> Service<State, Request<ReqBody>> for ResponseWriterService<S, W>
Source§impl<State, ReqBody, F, FResBody> Service<State, Request<ReqBody>> for ServeDir<F>
impl<State, ReqBody, F, FResBody> Service<State, Request<ReqBody>> for ServeDir<F>
Source§impl<State, ReqBody> Service<State, Request<ReqBody>> for ServeFile
impl<State, ReqBody> Service<State, Request<ReqBody>> for ServeFile
Source§type Error = <ServeDir as Service<State, Request<ReqBody>>>::Error
type Error = <ServeDir as Service<State, Request<ReqBody>>>::Error
Source§type Response = <ServeDir as Service<State, Request<ReqBody>>>::Response
type Response = <ServeDir as Service<State, Request<ReqBody>>>::Response
Source§impl<ReqBody, ResBody, State, S, M> Service<State, Request<ReqBody>> for SetRequestHeader<S, M>
impl<ReqBody, ResBody, State, S, M> Service<State, Request<ReqBody>> for SetRequestHeader<S, M>
Source§type Response = <S as Service<State, Request<ReqBody>>>::Response
type Response = <S as Service<State, Request<ReqBody>>>::Response
Source§type Error = <S as Service<State, Request<ReqBody>>>::Error
type Error = <S as Service<State, Request<ReqBody>>>::Error
Source§impl<State, S, M, ReqBody, ResBody> Service<State, Request<ReqBody>> for SetRequestId<S, M>
impl<State, S, M, ReqBody, ResBody> Service<State, Request<ReqBody>> for SetRequestId<S, M>
Source§type Response = <S as Service<State, Request<ReqBody>>>::Response
type Response = <S as Service<State, Request<ReqBody>>>::Response
Source§type Error = <S as Service<State, Request<ReqBody>>>::Error
type Error = <S as Service<State, Request<ReqBody>>>::Error
Source§impl<ReqBody, ResBody, State, S, M> Service<State, Request<ReqBody>> for SetResponseHeader<S, M>
impl<ReqBody, ResBody, State, S, M> Service<State, Request<ReqBody>> for SetResponseHeader<S, M>
Source§type Response = <S as Service<State, Request<ReqBody>>>::Response
type Response = <S as Service<State, Request<ReqBody>>>::Response
Source§type Error = <S as Service<State, Request<ReqBody>>>::Error
type Error = <S as Service<State, Request<ReqBody>>>::Error
Source§impl<ReqBody, ResBody, State, S> Service<State, Request<ReqBody>> for SetSensitiveRequestHeaders<S>
impl<ReqBody, ResBody, State, S> Service<State, Request<ReqBody>> for SetSensitiveRequestHeaders<S>
Source§type Response = <S as Service<State, Request<ReqBody>>>::Response
type Response = <S as Service<State, Request<ReqBody>>>::Response
Source§type Error = <S as Service<State, Request<ReqBody>>>::Error
type Error = <S as Service<State, Request<ReqBody>>>::Error
Source§impl<ReqBody, ResBody, State, S> Service<State, Request<ReqBody>> for SetSensitiveResponseHeaders<S>
impl<ReqBody, ResBody, State, S> Service<State, Request<ReqBody>> for SetSensitiveResponseHeaders<S>
Source§type Response = <S as Service<State, Request<ReqBody>>>::Response
type Response = <S as Service<State, Request<ReqBody>>>::Response
Source§type Error = <S as Service<State, Request<ReqBody>>>::Error
type Error = <S as Service<State, Request<ReqBody>>>::Error
Source§impl<State, S, ReqBody, ResBody> Service<State, Request<ReqBody>> for SetStatus<S>
impl<State, S, ReqBody, ResBody> Service<State, Request<ReqBody>> for SetStatus<S>
Source§type Response = <S as Service<State, Request<ReqBody>>>::Response
type Response = <S as Service<State, Request<ReqBody>>>::Response
Source§type Error = <S as Service<State, Request<ReqBody>>>::Error
type Error = <S as Service<State, Request<ReqBody>>>::Error
Source§impl<S, State, ReqBody, ResBody> Service<State, Request<ReqBody>> for Timeout<S>
impl<S, State, ReqBody, ResBody> Service<State, Request<ReqBody>> for Timeout<S>
Source§type Response = <S as Service<State, Request<ReqBody>>>::Response
type Response = <S as Service<State, Request<ReqBody>>>::Response
Source§type Error = <S as Service<State, Request<ReqBody>>>::Error
type Error = <S as Service<State, Request<ReqBody>>>::Error
Source§impl<S, State, ReqBody, ResBody, M, OnRequestT, OnResponseT, OnFailureT, OnBodyChunkT, OnEosT, MakeSpanT> Service<State, Request<ReqBody>> for Trace<S, M, MakeSpanT, OnRequestT, OnResponseT, OnBodyChunkT, OnEosT, OnFailureT>where
S: Service<State, Request<ReqBody>, Response = Response<ResBody>, Error: Display>,
State: Clone + Send + Sync + 'static,
ReqBody: HttpBody + Send + 'static,
ResBody: HttpBody<Error: Display> + Send + Sync + 'static,
M: MakeClassifier<Classifier: Clone>,
MakeSpanT: MakeSpan<ReqBody>,
OnRequestT: OnRequest<ReqBody>,
OnResponseT: OnResponse<ResBody> + Clone,
OnBodyChunkT: OnBodyChunk<ResBody::Data> + Clone,
OnEosT: OnEos + Clone,
OnFailureT: OnFailure<M::FailureClass> + Clone,
impl<S, State, ReqBody, ResBody, M, OnRequestT, OnResponseT, OnFailureT, OnBodyChunkT, OnEosT, MakeSpanT> Service<State, Request<ReqBody>> for Trace<S, M, MakeSpanT, OnRequestT, OnResponseT, OnBodyChunkT, OnEosT, OnFailureT>where
S: Service<State, Request<ReqBody>, Response = Response<ResBody>, Error: Display>,
State: Clone + Send + Sync + 'static,
ReqBody: HttpBody + Send + 'static,
ResBody: HttpBody<Error: Display> + Send + Sync + 'static,
M: MakeClassifier<Classifier: Clone>,
MakeSpanT: MakeSpan<ReqBody>,
OnRequestT: OnRequest<ReqBody>,
OnResponseT: OnResponse<ResBody> + Clone,
OnBodyChunkT: OnBodyChunk<ResBody::Data> + Clone,
OnEosT: OnEos + Clone,
OnFailureT: OnFailure<M::FailureClass> + Clone,
Source§type Response = Response<ResponseBody<ResBody, <M as MakeClassifier>::ClassifyEos, OnBodyChunkT, OnEosT, OnFailureT>>
type Response = Response<ResponseBody<ResBody, <M as MakeClassifier>::ClassifyEos, OnBodyChunkT, OnEosT, OnFailureT>>
Source§type Error = <S as Service<State, Request<ReqBody>>>::Error
type Error = <S as Service<State, Request<ReqBody>>>::Error
Source§impl<ReqBody, ResBody, State, S, V> Service<State, Request<ReqBody>> for ValidateRequestHeader<S, V>
impl<ReqBody, ResBody, State, S, V> Service<State, Request<ReqBody>> for ValidateRequestHeader<S, V>
Source§impl<State, Body> TryRefIntoTransportContext<State> for Request<Body>
impl<State, Body> TryRefIntoTransportContext<State> for Request<Body>
Source§type Error = OpaqueError
type Error = OpaqueError
Source§fn try_ref_into_transport_ctx(
&self,
ctx: &Context<State>,
) -> Result<TransportContext, <Request<Body> as TryRefIntoTransportContext<State>>::Error>
fn try_ref_into_transport_ctx( &self, ctx: &Context<State>, ) -> Result<TransportContext, <Request<Body> as TryRefIntoTransportContext<State>>::Error>
Auto Trait Implementations§
impl<T> !Freeze for Request<T>
impl<T> !RefUnwindSafe for Request<T>
impl<T> Send for Request<T>where
T: Send,
impl<T> Sync for Request<T>where
T: Sync,
impl<T> Unpin for Request<T>where
T: Unpin,
impl<T> !UnwindSafe for Request<T>
Blanket Implementations§
Source§impl<T> BodyExt for T
impl<T> BodyExt for T
Source§fn frame(&mut self) -> Frame<'_, Self> ⓘwhere
Self: Unpin,
fn frame(&mut self) -> Frame<'_, Self> ⓘwhere
Self: Unpin,
Frame
, if any.Source§fn map_frame<F, B>(self, f: F) -> MapFrame<Self, F>
fn map_frame<F, B>(self, f: F) -> MapFrame<Self, F>
Source§fn map_err<F, E>(self, f: F) -> MapErr<Self, F>
fn map_err<F, E>(self, f: F) -> MapErr<Self, F>
Source§fn boxed_unsync(self) -> UnsyncBoxBody<Self::Data, Self::Error>
fn boxed_unsync(self) -> UnsyncBoxBody<Self::Data, Self::Error>
Source§fn collect(self) -> Collect<Self> ⓘwhere
Self: Sized,
fn collect(self) -> Collect<Self> ⓘwhere
Self: Sized,
Collected
body which will collect all the DATA frames
and trailers.Source§fn with_trailers<F>(self, trailers: F) -> WithTrailers<Self, F>
fn with_trailers<F>(self, trailers: F) -> WithTrailers<Self, F>
Source§fn into_data_stream(self) -> BodyDataStream<Self>where
Self: Sized,
fn into_data_stream(self) -> BodyDataStream<Self>where
Self: Sized,
BodyDataStream
.Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more