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
sourceimpl 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 where
Uri: TryFrom<T>,
<Uri as TryFrom<T>>::Error: Into<Error>,
pub fn get<T>(uri: T) -> Builder where
Uri: TryFrom<T>,
<Uri as TryFrom<T>>::Error: Into<Error>,
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 where
Uri: TryFrom<T>,
<Uri as TryFrom<T>>::Error: Into<Error>,
pub fn put<T>(uri: T) -> Builder where
Uri: TryFrom<T>,
<Uri as TryFrom<T>>::Error: Into<Error>,
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 where
Uri: TryFrom<T>,
<Uri as TryFrom<T>>::Error: Into<Error>,
pub fn post<T>(uri: T) -> Builder where
Uri: TryFrom<T>,
<Uri as TryFrom<T>>::Error: Into<Error>,
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 where
Uri: TryFrom<T>,
<Uri as TryFrom<T>>::Error: Into<Error>,
pub fn delete<T>(uri: T) -> Builder where
Uri: TryFrom<T>,
<Uri as TryFrom<T>>::Error: Into<Error>,
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 where
Uri: TryFrom<T>,
<Uri as TryFrom<T>>::Error: Into<Error>,
pub fn options<T>(uri: T) -> Builder where
Uri: TryFrom<T>,
<Uri as TryFrom<T>>::Error: Into<Error>,
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 where
Uri: TryFrom<T>,
<Uri as TryFrom<T>>::Error: Into<Error>,
pub fn head<T>(uri: T) -> Builder where
Uri: TryFrom<T>,
<Uri as TryFrom<T>>::Error: Into<Error>,
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 where
Uri: TryFrom<T>,
<Uri as TryFrom<T>>::Error: Into<Error>,
pub fn connect<T>(uri: T) -> Builder where
Uri: TryFrom<T>,
<Uri as TryFrom<T>>::Error: Into<Error>,
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 where
Uri: TryFrom<T>,
<Uri as TryFrom<T>>::Error: Into<Error>,
pub fn patch<T>(uri: T) -> Builder where
Uri: TryFrom<T>,
<Uri as TryFrom<T>>::Error: Into<Error>,
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();sourcepub fn trace<T>(uri: T) -> Builder where
Uri: TryFrom<T>,
<Uri as TryFrom<T>>::Error: Into<Error>,
pub fn trace<T>(uri: T) -> Builder where
Uri: TryFrom<T>,
<Uri as TryFrom<T>>::Error: Into<Error>,
Creates a new Builder initialized with a TRACE method and the given URI.
This method returns an instance of Builder which can be used to
create a Request.
Example
let request = Request::trace("https://www.rust-lang.org/")
.body(())
.unwrap();sourceimpl<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<HeaderValue>
pub fn headers(&self) -> &HeaderMap<HeaderValue>
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<HeaderValue>
pub fn headers_mut(&mut self) -> &mut HeaderMap<HeaderValue>
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
sourceimpl<B> Body for Request<B> where
B: Body,
impl<B> Body for Request<B> where
B: Body,
sourcefn poll_data(
self: Pin<&mut Request<B>>,
cx: &mut Context<'_>
) -> Poll<Option<Result<<Request<B> as Body>::Data, <Request<B> as Body>::Error>>>
fn poll_data(
self: Pin<&mut Request<B>>,
cx: &mut Context<'_>
) -> Poll<Option<Result<<Request<B> as Body>::Data, <Request<B> as Body>::Error>>>
Attempt to pull out the next data buffer of this stream.
sourcefn poll_trailers(
self: Pin<&mut Request<B>>,
cx: &mut Context<'_>
) -> Poll<Result<Option<HeaderMap<HeaderValue>>, <Request<B> as Body>::Error>>
fn poll_trailers(
self: Pin<&mut Request<B>>,
cx: &mut Context<'_>
) -> Poll<Result<Option<HeaderMap<HeaderValue>>, <Request<B> as Body>::Error>>
Poll for an optional single HeaderMap of trailers. Read more
sourcefn is_end_stream(&self) -> bool
fn is_end_stream(&self) -> bool
Returns true when the end of stream has been reached. Read more
sourcefn size_hint(&self) -> SizeHint
fn size_hint(&self) -> SizeHint
Returns the bounds on the remaining length of the stream. Read more
sourcefn data(&mut self) -> Data<'_, Self> where
Self: Unpin,
fn data(&mut self) -> Data<'_, Self> where
Self: Unpin,
Returns future that resolves to next data chunk, if any.
sourcefn trailers(&mut self) -> Trailers<'_, Self> where
Self: Unpin,
fn trailers(&mut self) -> Trailers<'_, Self> where
Self: Unpin,
Returns future that resolves to trailers, if any.
sourcefn map_data<F, B>(self, f: F) -> MapData<Self, F> where
F: FnMut(Self::Data) -> B,
B: Buf,
fn map_data<F, B>(self, f: F) -> MapData<Self, F> where
F: FnMut(Self::Data) -> B,
B: Buf,
Maps this body’s data value to a different value.
sourcefn map_err<F, E>(self, f: F) -> MapErr<Self, F> where
F: FnMut(Self::Error) -> E,
fn map_err<F, E>(self, f: F) -> MapErr<Self, F> where
F: FnMut(Self::Error) -> E,
Maps this body’s error value to a different value.
sourcefn boxed(self) -> BoxBody<Self::Data, Self::Error> where
Self: 'static + Send + Sync,
fn boxed(self) -> BoxBody<Self::Data, Self::Error> where
Self: 'static + Send + Sync,
Turn this body into a boxed trait object.
sourcefn boxed_unsync(self) -> UnsyncBoxBody<Self::Data, Self::Error> where
Self: 'static + Send,
fn boxed_unsync(self) -> UnsyncBoxBody<Self::Data, Self::Error> where
Self: 'static + Send,
Turn this body into a boxed trait object that is !Sync.
impl<B> FromRequest<B> for Request<B> where
B: Send,
impl<B> FromRequest<B> for Request<B> where
B: Send,
type Rejection = BodyAlreadyExtracted
type Rejection = BodyAlreadyExtracted
If the extractor fails it’ll use this “rejection” type. A rejection is a kind of error that can be converted into a response. Read more
fn from_request<'life0, 'async_trait>(
req: &'life0 mut RequestParts<B>
) -> Pin<Box<dyn Future<Output = Result<Request<B>, <Request<B> as FromRequest<B>>::Rejection>> + Send + 'async_trait, Global>> where
'life0: 'async_trait,
Request<B>: 'async_trait,
fn from_request<'life0, 'async_trait>(
req: &'life0 mut RequestParts<B>
) -> Pin<Box<dyn Future<Output = Result<Request<B>, <Request<B> as FromRequest<B>>::Rejection>> + Send + 'async_trait, Global>> where
'life0: 'async_trait,
Request<B>: 'async_trait,
Perform the extraction.
impl IntoClientRequest for Request<()>
impl IntoClientRequest for Request<()>
fn into_client_request(self) -> Result<Request<()>, Error>
fn into_client_request(self) -> Result<Request<()>, Error>
Convert into a Request that can be used for a client connection.
sourceimpl<T, ResBody, ReqBody> Predicate<Request<ReqBody>, ResBody> for AddSession<T> where
T: Send + Sync + 'static,
impl<T, ResBody, ReqBody> Predicate<Request<ReqBody>, ResBody> for AddSession<T> where
T: Send + Sync + 'static,
sourceimpl<T, ResBody, ReqBody> Predicate<Request<ReqBody>, ResBody> for RequireSession<T> where
T: Clone + Send + Sync + 'static,
ResBody: Default,
impl<T, ResBody, ReqBody> Predicate<Request<ReqBody>, ResBody> for RequireSession<T> where
T: Clone + Send + Sync + 'static,
ResBody: Default,
sourceimpl<B, E> Service<Request<B>> for MethodRouter<B, E> where
B: Body,
impl<B, E> Service<Request<B>> for MethodRouter<B, E> where
B: Body,
type Response = Response<UnsyncBoxBody<Bytes, Error>>
type Response = Response<UnsyncBoxBody<Bytes, Error>>
Responses given by the service.
type Error = E
type Error = E
Errors produced by the service.
type Future = RouteFuture<B, E>
type Future = RouteFuture<B, E>
The future response value.
sourceimpl<B> Service<Request<B>> for Router<B> where
B: 'static + Body + Send,
impl<B> Service<Request<B>> for Router<B> where
B: 'static + Body + Send,
type Response = Response<UnsyncBoxBody<Bytes, Error>>
type Response = Response<UnsyncBoxBody<Bytes, Error>>
Responses given by the service.
type Error = Infallible
type Error = Infallible
Errors produced by the service.
type Future = RouteFuture<B, Infallible>
type Future = RouteFuture<B, Infallible>
The future response value.
sourceimpl<H, T, B> Service<Request<B>> for IntoService<H, T, B> where
H: 'static + Handler<T, B> + Clone + Send,
B: 'static + Send,
impl<H, T, B> Service<Request<B>> for IntoService<H, T, B> where
H: 'static + Handler<T, B> + Clone + Send,
B: 'static + Send,
type Response = Response<UnsyncBoxBody<Bytes, Error>>
type Response = Response<UnsyncBoxBody<Bytes, Error>>
Responses given by the service.
type Error = Infallible
type Error = Infallible
Errors produced by the service.
type Future = IntoServiceFuture<<H as Handler<T, B>>::Future>
type Future = IntoServiceFuture<<H as Handler<T, B>>::Future>
The future response value.
sourceimpl<B, E> Service<Request<B>> for Route<B, E> where
B: Body,
impl<B, E> Service<Request<B>> for Route<B, E> where
B: Body,
type Response = Response<UnsyncBoxBody<Bytes, Error>>
type Response = Response<UnsyncBoxBody<Bytes, Error>>
Responses given by the service.
type Error = E
type Error = E
Errors produced by the service.
type Future = RouteFuture<B, E>
type Future = RouteFuture<B, E>
The future response value.
sourceimpl<S, F, ReqBody, ResBody, Res, Fut, T1, T2> Service<Request<ReqBody>> for HandleError<S, F, (T1, T2)> where
S: 'static + Service<Request<ReqBody>, Response = Response<ResBody>> + Clone + Send,
F: 'static + FnOnce(T1, T2, <S as Service<Request<ReqBody>>>::Error) -> Fut + Clone + Send,
Fut: Future<Output = Res> + Send,
Res: IntoResponse,
T1: FromRequest<ReqBody> + Send,
T2: FromRequest<ReqBody> + Send,
ReqBody: 'static + Send,
ResBody: 'static + Body<Data = Bytes> + Send,
<S as Service<Request<ReqBody>>>::Error: Send,
<S as Service<Request<ReqBody>>>::Future: Send,
<ResBody as Body>::Error: Into<Box<dyn Error + Sync + Send + 'static, Global>>,
impl<S, F, ReqBody, ResBody, Res, Fut, T1, T2> Service<Request<ReqBody>> for HandleError<S, F, (T1, T2)> where
S: 'static + Service<Request<ReqBody>, Response = Response<ResBody>> + Clone + Send,
F: 'static + FnOnce(T1, T2, <S as Service<Request<ReqBody>>>::Error) -> Fut + Clone + Send,
Fut: Future<Output = Res> + Send,
Res: IntoResponse,
T1: FromRequest<ReqBody> + Send,
T2: FromRequest<ReqBody> + Send,
ReqBody: 'static + Send,
ResBody: 'static + Body<Data = Bytes> + Send,
<S as Service<Request<ReqBody>>>::Error: Send,
<S as Service<Request<ReqBody>>>::Future: Send,
<ResBody as Body>::Error: Into<Box<dyn Error + Sync + Send + 'static, Global>>,
type Response = Response<UnsyncBoxBody<Bytes, Error>>
type Response = Response<UnsyncBoxBody<Bytes, Error>>
Responses given by the service.
type Error = Infallible
type Error = Infallible
Errors produced by the service.
type Future = HandleErrorFuture
type Future = HandleErrorFuture
The future response value.
sourceimpl<S, F, ReqBody, ResBody, Res, Fut, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> Service<Request<ReqBody>> for HandleError<S, F, (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13)> where
S: 'static + Service<Request<ReqBody>, Response = Response<ResBody>> + Clone + Send,
F: 'static + FnOnce(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, <S as Service<Request<ReqBody>>>::Error) -> Fut + Clone + Send,
Fut: Future<Output = Res> + Send,
Res: IntoResponse,
T1: FromRequest<ReqBody> + Send,
T2: FromRequest<ReqBody> + Send,
T3: FromRequest<ReqBody> + Send,
T4: FromRequest<ReqBody> + Send,
T5: FromRequest<ReqBody> + Send,
T6: FromRequest<ReqBody> + Send,
T7: FromRequest<ReqBody> + Send,
T8: FromRequest<ReqBody> + Send,
T9: FromRequest<ReqBody> + Send,
T10: FromRequest<ReqBody> + Send,
T11: FromRequest<ReqBody> + Send,
T12: FromRequest<ReqBody> + Send,
T13: FromRequest<ReqBody> + Send,
ReqBody: 'static + Send,
ResBody: 'static + Body<Data = Bytes> + Send,
<S as Service<Request<ReqBody>>>::Error: Send,
<S as Service<Request<ReqBody>>>::Future: Send,
<ResBody as Body>::Error: Into<Box<dyn Error + Sync + Send + 'static, Global>>,
impl<S, F, ReqBody, ResBody, Res, Fut, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> Service<Request<ReqBody>> for HandleError<S, F, (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13)> where
S: 'static + Service<Request<ReqBody>, Response = Response<ResBody>> + Clone + Send,
F: 'static + FnOnce(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, <S as Service<Request<ReqBody>>>::Error) -> Fut + Clone + Send,
Fut: Future<Output = Res> + Send,
Res: IntoResponse,
T1: FromRequest<ReqBody> + Send,
T2: FromRequest<ReqBody> + Send,
T3: FromRequest<ReqBody> + Send,
T4: FromRequest<ReqBody> + Send,
T5: FromRequest<ReqBody> + Send,
T6: FromRequest<ReqBody> + Send,
T7: FromRequest<ReqBody> + Send,
T8: FromRequest<ReqBody> + Send,
T9: FromRequest<ReqBody> + Send,
T10: FromRequest<ReqBody> + Send,
T11: FromRequest<ReqBody> + Send,
T12: FromRequest<ReqBody> + Send,
T13: FromRequest<ReqBody> + Send,
ReqBody: 'static + Send,
ResBody: 'static + Body<Data = Bytes> + Send,
<S as Service<Request<ReqBody>>>::Error: Send,
<S as Service<Request<ReqBody>>>::Future: Send,
<ResBody as Body>::Error: Into<Box<dyn Error + Sync + Send + 'static, Global>>,
type Response = Response<UnsyncBoxBody<Bytes, Error>>
type Response = Response<UnsyncBoxBody<Bytes, Error>>
Responses given by the service.
type Error = Infallible
type Error = Infallible
Errors produced by the service.
type Future = HandleErrorFuture
type Future = HandleErrorFuture
The future response value.
sourcefn poll_ready(
&mut self,
&mut Context<'_>
) -> Poll<Result<(), <HandleError<S, F, (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13)> as Service<Request<ReqBody>>>::Error>>
fn poll_ready(
&mut self,
&mut Context<'_>
) -> Poll<Result<(), <HandleError<S, F, (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13)> as Service<Request<ReqBody>>>::Error>>
Returns Poll::Ready(Ok(())) when the service is able to process requests. Read more
sourcefn call(
&mut self,
req: Request<ReqBody>
) -> <HandleError<S, F, (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13)> as Service<Request<ReqBody>>>::Future
fn call(
&mut self,
req: Request<ReqBody>
) -> <HandleError<S, F, (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13)> as Service<Request<ReqBody>>>::Future
Process the request and return the response asynchronously. Read more
sourceimpl<S, F, ReqBody, ResBody, Res, Fut, T1, T2, T3, T4, T5> Service<Request<ReqBody>> for HandleError<S, F, (T1, T2, T3, T4, T5)> where
S: 'static + Service<Request<ReqBody>, Response = Response<ResBody>> + Clone + Send,
F: 'static + FnOnce(T1, T2, T3, T4, T5, <S as Service<Request<ReqBody>>>::Error) -> Fut + Clone + Send,
Fut: Future<Output = Res> + Send,
Res: IntoResponse,
T1: FromRequest<ReqBody> + Send,
T2: FromRequest<ReqBody> + Send,
T3: FromRequest<ReqBody> + Send,
T4: FromRequest<ReqBody> + Send,
T5: FromRequest<ReqBody> + Send,
ReqBody: 'static + Send,
ResBody: 'static + Body<Data = Bytes> + Send,
<S as Service<Request<ReqBody>>>::Error: Send,
<S as Service<Request<ReqBody>>>::Future: Send,
<ResBody as Body>::Error: Into<Box<dyn Error + Sync + Send + 'static, Global>>,
impl<S, F, ReqBody, ResBody, Res, Fut, T1, T2, T3, T4, T5> Service<Request<ReqBody>> for HandleError<S, F, (T1, T2, T3, T4, T5)> where
S: 'static + Service<Request<ReqBody>, Response = Response<ResBody>> + Clone + Send,
F: 'static + FnOnce(T1, T2, T3, T4, T5, <S as Service<Request<ReqBody>>>::Error) -> Fut + Clone + Send,
Fut: Future<Output = Res> + Send,
Res: IntoResponse,
T1: FromRequest<ReqBody> + Send,
T2: FromRequest<ReqBody> + Send,
T3: FromRequest<ReqBody> + Send,
T4: FromRequest<ReqBody> + Send,
T5: FromRequest<ReqBody> + Send,
ReqBody: 'static + Send,
ResBody: 'static + Body<Data = Bytes> + Send,
<S as Service<Request<ReqBody>>>::Error: Send,
<S as Service<Request<ReqBody>>>::Future: Send,
<ResBody as Body>::Error: Into<Box<dyn Error + Sync + Send + 'static, Global>>,
type Response = Response<UnsyncBoxBody<Bytes, Error>>
type Response = Response<UnsyncBoxBody<Bytes, Error>>
Responses given by the service.
type Error = Infallible
type Error = Infallible
Errors produced by the service.
type Future = HandleErrorFuture
type Future = HandleErrorFuture
The future response value.
sourcefn poll_ready(
&mut self,
&mut Context<'_>
) -> Poll<Result<(), <HandleError<S, F, (T1, T2, T3, T4, T5)> as Service<Request<ReqBody>>>::Error>>
fn poll_ready(
&mut self,
&mut Context<'_>
) -> Poll<Result<(), <HandleError<S, F, (T1, T2, T3, T4, T5)> as Service<Request<ReqBody>>>::Error>>
Returns Poll::Ready(Ok(())) when the service is able to process requests. Read more
sourcefn call(
&mut self,
req: Request<ReqBody>
) -> <HandleError<S, F, (T1, T2, T3, T4, T5)> as Service<Request<ReqBody>>>::Future
fn call(
&mut self,
req: Request<ReqBody>
) -> <HandleError<S, F, (T1, T2, T3, T4, T5)> as Service<Request<ReqBody>>>::Future
Process the request and return the response asynchronously. Read more
sourceimpl<S, F, ReqBody, ResBody, Res, Fut, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> Service<Request<ReqBody>> for HandleError<S, F, (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16)> where
S: 'static + Service<Request<ReqBody>, Response = Response<ResBody>> + Clone + Send,
F: 'static + FnOnce(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, <S as Service<Request<ReqBody>>>::Error) -> Fut + Clone + Send,
Fut: Future<Output = Res> + Send,
Res: IntoResponse,
T1: FromRequest<ReqBody> + Send,
T2: FromRequest<ReqBody> + Send,
T3: FromRequest<ReqBody> + Send,
T4: FromRequest<ReqBody> + Send,
T5: FromRequest<ReqBody> + Send,
T6: FromRequest<ReqBody> + Send,
T7: FromRequest<ReqBody> + Send,
T8: FromRequest<ReqBody> + Send,
T9: FromRequest<ReqBody> + Send,
T10: FromRequest<ReqBody> + Send,
T11: FromRequest<ReqBody> + Send,
T12: FromRequest<ReqBody> + Send,
T13: FromRequest<ReqBody> + Send,
T14: FromRequest<ReqBody> + Send,
T15: FromRequest<ReqBody> + Send,
T16: FromRequest<ReqBody> + Send,
ReqBody: 'static + Send,
ResBody: 'static + Body<Data = Bytes> + Send,
<S as Service<Request<ReqBody>>>::Error: Send,
<S as Service<Request<ReqBody>>>::Future: Send,
<ResBody as Body>::Error: Into<Box<dyn Error + Sync + Send + 'static, Global>>,
impl<S, F, ReqBody, ResBody, Res, Fut, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> Service<Request<ReqBody>> for HandleError<S, F, (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16)> where
S: 'static + Service<Request<ReqBody>, Response = Response<ResBody>> + Clone + Send,
F: 'static + FnOnce(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, <S as Service<Request<ReqBody>>>::Error) -> Fut + Clone + Send,
Fut: Future<Output = Res> + Send,
Res: IntoResponse,
T1: FromRequest<ReqBody> + Send,
T2: FromRequest<ReqBody> + Send,
T3: FromRequest<ReqBody> + Send,
T4: FromRequest<ReqBody> + Send,
T5: FromRequest<ReqBody> + Send,
T6: FromRequest<ReqBody> + Send,
T7: FromRequest<ReqBody> + Send,
T8: FromRequest<ReqBody> + Send,
T9: FromRequest<ReqBody> + Send,
T10: FromRequest<ReqBody> + Send,
T11: FromRequest<ReqBody> + Send,
T12: FromRequest<ReqBody> + Send,
T13: FromRequest<ReqBody> + Send,
T14: FromRequest<ReqBody> + Send,
T15: FromRequest<ReqBody> + Send,
T16: FromRequest<ReqBody> + Send,
ReqBody: 'static + Send,
ResBody: 'static + Body<Data = Bytes> + Send,
<S as Service<Request<ReqBody>>>::Error: Send,
<S as Service<Request<ReqBody>>>::Future: Send,
<ResBody as Body>::Error: Into<Box<dyn Error + Sync + Send + 'static, Global>>,
type Response = Response<UnsyncBoxBody<Bytes, Error>>
type Response = Response<UnsyncBoxBody<Bytes, Error>>
Responses given by the service.
type Error = Infallible
type Error = Infallible
Errors produced by the service.
type Future = HandleErrorFuture
type Future = HandleErrorFuture
The future response value.
sourcefn poll_ready(
&mut self,
&mut Context<'_>
) -> Poll<Result<(), <HandleError<S, F, (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16)> as Service<Request<ReqBody>>>::Error>>
fn poll_ready(
&mut self,
&mut Context<'_>
) -> Poll<Result<(), <HandleError<S, F, (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16)> as Service<Request<ReqBody>>>::Error>>
Returns Poll::Ready(Ok(())) when the service is able to process requests. Read more
sourcefn call(
&mut self,
req: Request<ReqBody>
) -> <HandleError<S, F, (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16)> as Service<Request<ReqBody>>>::Future
fn call(
&mut self,
req: Request<ReqBody>
) -> <HandleError<S, F, (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16)> as Service<Request<ReqBody>>>::Future
Process the request and return the response asynchronously. Read more
sourceimpl<S, F, ReqBody, ResBody, Res, Fut, T1, T2, T3, T4, T5, T6, T7, T8> Service<Request<ReqBody>> for HandleError<S, F, (T1, T2, T3, T4, T5, T6, T7, T8)> where
S: 'static + Service<Request<ReqBody>, Response = Response<ResBody>> + Clone + Send,
F: 'static + FnOnce(T1, T2, T3, T4, T5, T6, T7, T8, <S as Service<Request<ReqBody>>>::Error) -> Fut + Clone + Send,
Fut: Future<Output = Res> + Send,
Res: IntoResponse,
T1: FromRequest<ReqBody> + Send,
T2: FromRequest<ReqBody> + Send,
T3: FromRequest<ReqBody> + Send,
T4: FromRequest<ReqBody> + Send,
T5: FromRequest<ReqBody> + Send,
T6: FromRequest<ReqBody> + Send,
T7: FromRequest<ReqBody> + Send,
T8: FromRequest<ReqBody> + Send,
ReqBody: 'static + Send,
ResBody: 'static + Body<Data = Bytes> + Send,
<S as Service<Request<ReqBody>>>::Error: Send,
<S as Service<Request<ReqBody>>>::Future: Send,
<ResBody as Body>::Error: Into<Box<dyn Error + Sync + Send + 'static, Global>>,
impl<S, F, ReqBody, ResBody, Res, Fut, T1, T2, T3, T4, T5, T6, T7, T8> Service<Request<ReqBody>> for HandleError<S, F, (T1, T2, T3, T4, T5, T6, T7, T8)> where
S: 'static + Service<Request<ReqBody>, Response = Response<ResBody>> + Clone + Send,
F: 'static + FnOnce(T1, T2, T3, T4, T5, T6, T7, T8, <S as Service<Request<ReqBody>>>::Error) -> Fut + Clone + Send,
Fut: Future<Output = Res> + Send,
Res: IntoResponse,
T1: FromRequest<ReqBody> + Send,
T2: FromRequest<ReqBody> + Send,
T3: FromRequest<ReqBody> + Send,
T4: FromRequest<ReqBody> + Send,
T5: FromRequest<ReqBody> + Send,
T6: FromRequest<ReqBody> + Send,
T7: FromRequest<ReqBody> + Send,
T8: FromRequest<ReqBody> + Send,
ReqBody: 'static + Send,
ResBody: 'static + Body<Data = Bytes> + Send,
<S as Service<Request<ReqBody>>>::Error: Send,
<S as Service<Request<ReqBody>>>::Future: Send,
<ResBody as Body>::Error: Into<Box<dyn Error + Sync + Send + 'static, Global>>,
type Response = Response<UnsyncBoxBody<Bytes, Error>>
type Response = Response<UnsyncBoxBody<Bytes, Error>>
Responses given by the service.
type Error = Infallible
type Error = Infallible
Errors produced by the service.
type Future = HandleErrorFuture
type Future = HandleErrorFuture
The future response value.
sourcefn poll_ready(
&mut self,
&mut Context<'_>
) -> Poll<Result<(), <HandleError<S, F, (T1, T2, T3, T4, T5, T6, T7, T8)> as Service<Request<ReqBody>>>::Error>>
fn poll_ready(
&mut self,
&mut Context<'_>
) -> Poll<Result<(), <HandleError<S, F, (T1, T2, T3, T4, T5, T6, T7, T8)> as Service<Request<ReqBody>>>::Error>>
Returns Poll::Ready(Ok(())) when the service is able to process requests. Read more
sourcefn call(
&mut self,
req: Request<ReqBody>
) -> <HandleError<S, F, (T1, T2, T3, T4, T5, T6, T7, T8)> as Service<Request<ReqBody>>>::Future
fn call(
&mut self,
req: Request<ReqBody>
) -> <HandleError<S, F, (T1, T2, T3, T4, T5, T6, T7, T8)> as Service<Request<ReqBody>>>::Future
Process the request and return the response asynchronously. Read more
sourceimpl<S, F, ReqBody, ResBody, Res, Fut, T1, T2, T3, T4, T5, T6, T7, T8, T9> Service<Request<ReqBody>> for HandleError<S, F, (T1, T2, T3, T4, T5, T6, T7, T8, T9)> where
S: 'static + Service<Request<ReqBody>, Response = Response<ResBody>> + Clone + Send,
F: 'static + FnOnce(T1, T2, T3, T4, T5, T6, T7, T8, T9, <S as Service<Request<ReqBody>>>::Error) -> Fut + Clone + Send,
Fut: Future<Output = Res> + Send,
Res: IntoResponse,
T1: FromRequest<ReqBody> + Send,
T2: FromRequest<ReqBody> + Send,
T3: FromRequest<ReqBody> + Send,
T4: FromRequest<ReqBody> + Send,
T5: FromRequest<ReqBody> + Send,
T6: FromRequest<ReqBody> + Send,
T7: FromRequest<ReqBody> + Send,
T8: FromRequest<ReqBody> + Send,
T9: FromRequest<ReqBody> + Send,
ReqBody: 'static + Send,
ResBody: 'static + Body<Data = Bytes> + Send,
<S as Service<Request<ReqBody>>>::Error: Send,
<S as Service<Request<ReqBody>>>::Future: Send,
<ResBody as Body>::Error: Into<Box<dyn Error + Sync + Send + 'static, Global>>,
impl<S, F, ReqBody, ResBody, Res, Fut, T1, T2, T3, T4, T5, T6, T7, T8, T9> Service<Request<ReqBody>> for HandleError<S, F, (T1, T2, T3, T4, T5, T6, T7, T8, T9)> where
S: 'static + Service<Request<ReqBody>, Response = Response<ResBody>> + Clone + Send,
F: 'static + FnOnce(T1, T2, T3, T4, T5, T6, T7, T8, T9, <S as Service<Request<ReqBody>>>::Error) -> Fut + Clone + Send,
Fut: Future<Output = Res> + Send,
Res: IntoResponse,
T1: FromRequest<ReqBody> + Send,
T2: FromRequest<ReqBody> + Send,
T3: FromRequest<ReqBody> + Send,
T4: FromRequest<ReqBody> + Send,
T5: FromRequest<ReqBody> + Send,
T6: FromRequest<ReqBody> + Send,
T7: FromRequest<ReqBody> + Send,
T8: FromRequest<ReqBody> + Send,
T9: FromRequest<ReqBody> + Send,
ReqBody: 'static + Send,
ResBody: 'static + Body<Data = Bytes> + Send,
<S as Service<Request<ReqBody>>>::Error: Send,
<S as Service<Request<ReqBody>>>::Future: Send,
<ResBody as Body>::Error: Into<Box<dyn Error + Sync + Send + 'static, Global>>,
type Response = Response<UnsyncBoxBody<Bytes, Error>>
type Response = Response<UnsyncBoxBody<Bytes, Error>>
Responses given by the service.
type Error = Infallible
type Error = Infallible
Errors produced by the service.
type Future = HandleErrorFuture
type Future = HandleErrorFuture
The future response value.
sourcefn poll_ready(
&mut self,
&mut Context<'_>
) -> Poll<Result<(), <HandleError<S, F, (T1, T2, T3, T4, T5, T6, T7, T8, T9)> as Service<Request<ReqBody>>>::Error>>
fn poll_ready(
&mut self,
&mut Context<'_>
) -> Poll<Result<(), <HandleError<S, F, (T1, T2, T3, T4, T5, T6, T7, T8, T9)> as Service<Request<ReqBody>>>::Error>>
Returns Poll::Ready(Ok(())) when the service is able to process requests. Read more
sourcefn call(
&mut self,
req: Request<ReqBody>
) -> <HandleError<S, F, (T1, T2, T3, T4, T5, T6, T7, T8, T9)> as Service<Request<ReqBody>>>::Future
fn call(
&mut self,
req: Request<ReqBody>
) -> <HandleError<S, F, (T1, T2, T3, T4, T5, T6, T7, T8, T9)> as Service<Request<ReqBody>>>::Future
Process the request and return the response asynchronously. Read more
sourceimpl<S, F, ReqBody, ResBody, Res, Fut, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Service<Request<ReqBody>> for HandleError<S, F, (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)> where
S: 'static + Service<Request<ReqBody>, Response = Response<ResBody>> + Clone + Send,
F: 'static + FnOnce(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, <S as Service<Request<ReqBody>>>::Error) -> Fut + Clone + Send,
Fut: Future<Output = Res> + Send,
Res: IntoResponse,
T1: FromRequest<ReqBody> + Send,
T2: FromRequest<ReqBody> + Send,
T3: FromRequest<ReqBody> + Send,
T4: FromRequest<ReqBody> + Send,
T5: FromRequest<ReqBody> + Send,
T6: FromRequest<ReqBody> + Send,
T7: FromRequest<ReqBody> + Send,
T8: FromRequest<ReqBody> + Send,
T9: FromRequest<ReqBody> + Send,
T10: FromRequest<ReqBody> + Send,
T11: FromRequest<ReqBody> + Send,
ReqBody: 'static + Send,
ResBody: 'static + Body<Data = Bytes> + Send,
<S as Service<Request<ReqBody>>>::Error: Send,
<S as Service<Request<ReqBody>>>::Future: Send,
<ResBody as Body>::Error: Into<Box<dyn Error + Sync + Send + 'static, Global>>,
impl<S, F, ReqBody, ResBody, Res, Fut, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Service<Request<ReqBody>> for HandleError<S, F, (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)> where
S: 'static + Service<Request<ReqBody>, Response = Response<ResBody>> + Clone + Send,
F: 'static + FnOnce(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, <S as Service<Request<ReqBody>>>::Error) -> Fut + Clone + Send,
Fut: Future<Output = Res> + Send,
Res: IntoResponse,
T1: FromRequest<ReqBody> + Send,
T2: FromRequest<ReqBody> + Send,
T3: FromRequest<ReqBody> + Send,
T4: FromRequest<ReqBody> + Send,
T5: FromRequest<ReqBody> + Send,
T6: FromRequest<ReqBody> + Send,
T7: FromRequest<ReqBody> + Send,
T8: FromRequest<ReqBody> + Send,
T9: FromRequest<ReqBody> + Send,
T10: FromRequest<ReqBody> + Send,
T11: FromRequest<ReqBody> + Send,
ReqBody: 'static + Send,
ResBody: 'static + Body<Data = Bytes> + Send,
<S as Service<Request<ReqBody>>>::Error: Send,
<S as Service<Request<ReqBody>>>::Future: Send,
<ResBody as Body>::Error: Into<Box<dyn Error + Sync + Send + 'static, Global>>,
type Response = Response<UnsyncBoxBody<Bytes, Error>>
type Response = Response<UnsyncBoxBody<Bytes, Error>>
Responses given by the service.
type Error = Infallible
type Error = Infallible
Errors produced by the service.
type Future = HandleErrorFuture
type Future = HandleErrorFuture
The future response value.
sourcefn poll_ready(
&mut self,
&mut Context<'_>
) -> Poll<Result<(), <HandleError<S, F, (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)> as Service<Request<ReqBody>>>::Error>>
fn poll_ready(
&mut self,
&mut Context<'_>
) -> Poll<Result<(), <HandleError<S, F, (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)> as Service<Request<ReqBody>>>::Error>>
Returns Poll::Ready(Ok(())) when the service is able to process requests. Read more
sourcefn call(
&mut self,
req: Request<ReqBody>
) -> <HandleError<S, F, (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)> as Service<Request<ReqBody>>>::Future
fn call(
&mut self,
req: Request<ReqBody>
) -> <HandleError<S, F, (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)> as Service<Request<ReqBody>>>::Future
Process the request and return the response asynchronously. Read more
sourceimpl<S, F, ReqBody, ResBody, Res, Fut, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> Service<Request<ReqBody>> for HandleError<S, F, (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15)> where
S: 'static + Service<Request<ReqBody>, Response = Response<ResBody>> + Clone + Send,
F: 'static + FnOnce(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, <S as Service<Request<ReqBody>>>::Error) -> Fut + Clone + Send,
Fut: Future<Output = Res> + Send,
Res: IntoResponse,
T1: FromRequest<ReqBody> + Send,
T2: FromRequest<ReqBody> + Send,
T3: FromRequest<ReqBody> + Send,
T4: FromRequest<ReqBody> + Send,
T5: FromRequest<ReqBody> + Send,
T6: FromRequest<ReqBody> + Send,
T7: FromRequest<ReqBody> + Send,
T8: FromRequest<ReqBody> + Send,
T9: FromRequest<ReqBody> + Send,
T10: FromRequest<ReqBody> + Send,
T11: FromRequest<ReqBody> + Send,
T12: FromRequest<ReqBody> + Send,
T13: FromRequest<ReqBody> + Send,
T14: FromRequest<ReqBody> + Send,
T15: FromRequest<ReqBody> + Send,
ReqBody: 'static + Send,
ResBody: 'static + Body<Data = Bytes> + Send,
<S as Service<Request<ReqBody>>>::Error: Send,
<S as Service<Request<ReqBody>>>::Future: Send,
<ResBody as Body>::Error: Into<Box<dyn Error + Sync + Send + 'static, Global>>,
impl<S, F, ReqBody, ResBody, Res, Fut, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> Service<Request<ReqBody>> for HandleError<S, F, (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15)> where
S: 'static + Service<Request<ReqBody>, Response = Response<ResBody>> + Clone + Send,
F: 'static + FnOnce(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, <S as Service<Request<ReqBody>>>::Error) -> Fut + Clone + Send,
Fut: Future<Output = Res> + Send,
Res: IntoResponse,
T1: FromRequest<ReqBody> + Send,
T2: FromRequest<ReqBody> + Send,
T3: FromRequest<ReqBody> + Send,
T4: FromRequest<ReqBody> + Send,
T5: FromRequest<ReqBody> + Send,
T6: FromRequest<ReqBody> + Send,
T7: FromRequest<ReqBody> + Send,
T8: FromRequest<ReqBody> + Send,
T9: FromRequest<ReqBody> + Send,
T10: FromRequest<ReqBody> + Send,
T11: FromRequest<ReqBody> + Send,
T12: FromRequest<ReqBody> + Send,
T13: FromRequest<ReqBody> + Send,
T14: FromRequest<ReqBody> + Send,
T15: FromRequest<ReqBody> + Send,
ReqBody: 'static + Send,
ResBody: 'static + Body<Data = Bytes> + Send,
<S as Service<Request<ReqBody>>>::Error: Send,
<S as Service<Request<ReqBody>>>::Future: Send,
<ResBody as Body>::Error: Into<Box<dyn Error + Sync + Send + 'static, Global>>,
type Response = Response<UnsyncBoxBody<Bytes, Error>>
type Response = Response<UnsyncBoxBody<Bytes, Error>>
Responses given by the service.
type Error = Infallible
type Error = Infallible
Errors produced by the service.
type Future = HandleErrorFuture
type Future = HandleErrorFuture
The future response value.
sourcefn poll_ready(
&mut self,
&mut Context<'_>
) -> Poll<Result<(), <HandleError<S, F, (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15)> as Service<Request<ReqBody>>>::Error>>
fn poll_ready(
&mut self,
&mut Context<'_>
) -> Poll<Result<(), <HandleError<S, F, (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15)> as Service<Request<ReqBody>>>::Error>>
Returns Poll::Ready(Ok(())) when the service is able to process requests. Read more
sourcefn call(
&mut self,
req: Request<ReqBody>
) -> <HandleError<S, F, (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15)> as Service<Request<ReqBody>>>::Future
fn call(
&mut self,
req: Request<ReqBody>
) -> <HandleError<S, F, (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15)> as Service<Request<ReqBody>>>::Future
Process the request and return the response asynchronously. Read more
sourceimpl<S, F, ReqBody, ResBody, Res, Fut, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> Service<Request<ReqBody>> for HandleError<S, F, (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)> where
S: 'static + Service<Request<ReqBody>, Response = Response<ResBody>> + Clone + Send,
F: 'static + FnOnce(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, <S as Service<Request<ReqBody>>>::Error) -> Fut + Clone + Send,
Fut: Future<Output = Res> + Send,
Res: IntoResponse,
T1: FromRequest<ReqBody> + Send,
T2: FromRequest<ReqBody> + Send,
T3: FromRequest<ReqBody> + Send,
T4: FromRequest<ReqBody> + Send,
T5: FromRequest<ReqBody> + Send,
T6: FromRequest<ReqBody> + Send,
T7: FromRequest<ReqBody> + Send,
T8: FromRequest<ReqBody> + Send,
T9: FromRequest<ReqBody> + Send,
T10: FromRequest<ReqBody> + Send,
ReqBody: 'static + Send,
ResBody: 'static + Body<Data = Bytes> + Send,
<S as Service<Request<ReqBody>>>::Error: Send,
<S as Service<Request<ReqBody>>>::Future: Send,
<ResBody as Body>::Error: Into<Box<dyn Error + Sync + Send + 'static, Global>>,
impl<S, F, ReqBody, ResBody, Res, Fut, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> Service<Request<ReqBody>> for HandleError<S, F, (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)> where
S: 'static + Service<Request<ReqBody>, Response = Response<ResBody>> + Clone + Send,
F: 'static + FnOnce(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, <S as Service<Request<ReqBody>>>::Error) -> Fut + Clone + Send,
Fut: Future<Output = Res> + Send,
Res: IntoResponse,
T1: FromRequest<ReqBody> + Send,
T2: FromRequest<ReqBody> + Send,
T3: FromRequest<ReqBody> + Send,
T4: FromRequest<ReqBody> + Send,
T5: FromRequest<ReqBody> + Send,
T6: FromRequest<ReqBody> + Send,
T7: FromRequest<ReqBody> + Send,
T8: FromRequest<ReqBody> + Send,
T9: FromRequest<ReqBody> + Send,
T10: FromRequest<ReqBody> + Send,
ReqBody: 'static + Send,
ResBody: 'static + Body<Data = Bytes> + Send,
<S as Service<Request<ReqBody>>>::Error: Send,
<S as Service<Request<ReqBody>>>::Future: Send,
<ResBody as Body>::Error: Into<Box<dyn Error + Sync + Send + 'static, Global>>,
type Response = Response<UnsyncBoxBody<Bytes, Error>>
type Response = Response<UnsyncBoxBody<Bytes, Error>>
Responses given by the service.
type Error = Infallible
type Error = Infallible
Errors produced by the service.
type Future = HandleErrorFuture
type Future = HandleErrorFuture
The future response value.
sourcefn poll_ready(
&mut self,
&mut Context<'_>
) -> Poll<Result<(), <HandleError<S, F, (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)> as Service<Request<ReqBody>>>::Error>>
fn poll_ready(
&mut self,
&mut Context<'_>
) -> Poll<Result<(), <HandleError<S, F, (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)> as Service<Request<ReqBody>>>::Error>>
Returns Poll::Ready(Ok(())) when the service is able to process requests. Read more
sourcefn call(
&mut self,
req: Request<ReqBody>
) -> <HandleError<S, F, (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)> as Service<Request<ReqBody>>>::Future
fn call(
&mut self,
req: Request<ReqBody>
) -> <HandleError<S, F, (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)> as Service<Request<ReqBody>>>::Future
Process the request and return the response asynchronously. Read more
sourceimpl<S, F, ReqBody, ResBody, Res, Fut, T1, T2, T3, T4, T5, T6> Service<Request<ReqBody>> for HandleError<S, F, (T1, T2, T3, T4, T5, T6)> where
S: 'static + Service<Request<ReqBody>, Response = Response<ResBody>> + Clone + Send,
F: 'static + FnOnce(T1, T2, T3, T4, T5, T6, <S as Service<Request<ReqBody>>>::Error) -> Fut + Clone + Send,
Fut: Future<Output = Res> + Send,
Res: IntoResponse,
T1: FromRequest<ReqBody> + Send,
T2: FromRequest<ReqBody> + Send,
T3: FromRequest<ReqBody> + Send,
T4: FromRequest<ReqBody> + Send,
T5: FromRequest<ReqBody> + Send,
T6: FromRequest<ReqBody> + Send,
ReqBody: 'static + Send,
ResBody: 'static + Body<Data = Bytes> + Send,
<S as Service<Request<ReqBody>>>::Error: Send,
<S as Service<Request<ReqBody>>>::Future: Send,
<ResBody as Body>::Error: Into<Box<dyn Error + Sync + Send + 'static, Global>>,
impl<S, F, ReqBody, ResBody, Res, Fut, T1, T2, T3, T4, T5, T6> Service<Request<ReqBody>> for HandleError<S, F, (T1, T2, T3, T4, T5, T6)> where
S: 'static + Service<Request<ReqBody>, Response = Response<ResBody>> + Clone + Send,
F: 'static + FnOnce(T1, T2, T3, T4, T5, T6, <S as Service<Request<ReqBody>>>::Error) -> Fut + Clone + Send,
Fut: Future<Output = Res> + Send,
Res: IntoResponse,
T1: FromRequest<ReqBody> + Send,
T2: FromRequest<ReqBody> + Send,
T3: FromRequest<ReqBody> + Send,
T4: FromRequest<ReqBody> + Send,
T5: FromRequest<ReqBody> + Send,
T6: FromRequest<ReqBody> + Send,
ReqBody: 'static + Send,
ResBody: 'static + Body<Data = Bytes> + Send,
<S as Service<Request<ReqBody>>>::Error: Send,
<S as Service<Request<ReqBody>>>::Future: Send,
<ResBody as Body>::Error: Into<Box<dyn Error + Sync + Send + 'static, Global>>,
type Response = Response<UnsyncBoxBody<Bytes, Error>>
type Response = Response<UnsyncBoxBody<Bytes, Error>>
Responses given by the service.
type Error = Infallible
type Error = Infallible
Errors produced by the service.
type Future = HandleErrorFuture
type Future = HandleErrorFuture
The future response value.
sourcefn poll_ready(
&mut self,
&mut Context<'_>
) -> Poll<Result<(), <HandleError<S, F, (T1, T2, T3, T4, T5, T6)> as Service<Request<ReqBody>>>::Error>>
fn poll_ready(
&mut self,
&mut Context<'_>
) -> Poll<Result<(), <HandleError<S, F, (T1, T2, T3, T4, T5, T6)> as Service<Request<ReqBody>>>::Error>>
Returns Poll::Ready(Ok(())) when the service is able to process requests. Read more
sourcefn call(
&mut self,
req: Request<ReqBody>
) -> <HandleError<S, F, (T1, T2, T3, T4, T5, T6)> as Service<Request<ReqBody>>>::Future
fn call(
&mut self,
req: Request<ReqBody>
) -> <HandleError<S, F, (T1, T2, T3, T4, T5, T6)> as Service<Request<ReqBody>>>::Future
Process the request and return the response asynchronously. Read more
sourceimpl<S, F, ReqBody, ResBody, Res, Fut, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Service<Request<ReqBody>> for HandleError<S, F, (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12)> where
S: 'static + Service<Request<ReqBody>, Response = Response<ResBody>> + Clone + Send,
F: 'static + FnOnce(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, <S as Service<Request<ReqBody>>>::Error) -> Fut + Clone + Send,
Fut: Future<Output = Res> + Send,
Res: IntoResponse,
T1: FromRequest<ReqBody> + Send,
T2: FromRequest<ReqBody> + Send,
T3: FromRequest<ReqBody> + Send,
T4: FromRequest<ReqBody> + Send,
T5: FromRequest<ReqBody> + Send,
T6: FromRequest<ReqBody> + Send,
T7: FromRequest<ReqBody> + Send,
T8: FromRequest<ReqBody> + Send,
T9: FromRequest<ReqBody> + Send,
T10: FromRequest<ReqBody> + Send,
T11: FromRequest<ReqBody> + Send,
T12: FromRequest<ReqBody> + Send,
ReqBody: 'static + Send,
ResBody: 'static + Body<Data = Bytes> + Send,
<S as Service<Request<ReqBody>>>::Error: Send,
<S as Service<Request<ReqBody>>>::Future: Send,
<ResBody as Body>::Error: Into<Box<dyn Error + Sync + Send + 'static, Global>>,
impl<S, F, ReqBody, ResBody, Res, Fut, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Service<Request<ReqBody>> for HandleError<S, F, (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12)> where
S: 'static + Service<Request<ReqBody>, Response = Response<ResBody>> + Clone + Send,
F: 'static + FnOnce(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, <S as Service<Request<ReqBody>>>::Error) -> Fut + Clone + Send,
Fut: Future<Output = Res> + Send,
Res: IntoResponse,
T1: FromRequest<ReqBody> + Send,
T2: FromRequest<ReqBody> + Send,
T3: FromRequest<ReqBody> + Send,
T4: FromRequest<ReqBody> + Send,
T5: FromRequest<ReqBody> + Send,
T6: FromRequest<ReqBody> + Send,
T7: FromRequest<ReqBody> + Send,
T8: FromRequest<ReqBody> + Send,
T9: FromRequest<ReqBody> + Send,
T10: FromRequest<ReqBody> + Send,
T11: FromRequest<ReqBody> + Send,
T12: FromRequest<ReqBody> + Send,
ReqBody: 'static + Send,
ResBody: 'static + Body<Data = Bytes> + Send,
<S as Service<Request<ReqBody>>>::Error: Send,
<S as Service<Request<ReqBody>>>::Future: Send,
<ResBody as Body>::Error: Into<Box<dyn Error + Sync + Send + 'static, Global>>,
type Response = Response<UnsyncBoxBody<Bytes, Error>>
type Response = Response<UnsyncBoxBody<Bytes, Error>>
Responses given by the service.
type Error = Infallible
type Error = Infallible
Errors produced by the service.
type Future = HandleErrorFuture
type Future = HandleErrorFuture
The future response value.
sourcefn poll_ready(
&mut self,
&mut Context<'_>
) -> Poll<Result<(), <HandleError<S, F, (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12)> as Service<Request<ReqBody>>>::Error>>
fn poll_ready(
&mut self,
&mut Context<'_>
) -> Poll<Result<(), <HandleError<S, F, (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12)> as Service<Request<ReqBody>>>::Error>>
Returns Poll::Ready(Ok(())) when the service is able to process requests. Read more
sourcefn call(
&mut self,
req: Request<ReqBody>
) -> <HandleError<S, F, (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12)> as Service<Request<ReqBody>>>::Future
fn call(
&mut self,
req: Request<ReqBody>
) -> <HandleError<S, F, (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12)> as Service<Request<ReqBody>>>::Future
Process the request and return the response asynchronously. Read more
sourceimpl<T, U, ReqBody, ResBody> Service<Request<ReqBody>> for FilterEx<T, U, ResBody> where
T: Service<<U as Predicate<Request<ReqBody>, ResBody>>::Request, Response = Response<ResBody>>,
U: Predicate<Request<ReqBody>, ResBody, Response = Response<ResBody>>,
impl<T, U, ReqBody, ResBody> Service<Request<ReqBody>> for FilterEx<T, U, ResBody> where
T: Service<<U as Predicate<Request<ReqBody>, ResBody>>::Request, Response = Response<ResBody>>,
U: Predicate<Request<ReqBody>, ResBody, Response = Response<ResBody>>,
type Response = <T as Service<<U as Predicate<Request<ReqBody>, ResBody>>::Request>>::Response
type Response = <T as Service<<U as Predicate<Request<ReqBody>, ResBody>>::Request>>::Response
Responses given by the service.
type Error = <T as Service<<U as Predicate<Request<ReqBody>, ResBody>>::Request>>::Error
type Error = <T as Service<<U as Predicate<Request<ReqBody>, ResBody>>::Request>>::Error
Errors produced by the service.
type Future = ResponseFuture<<T as Service<<U as Predicate<Request<ReqBody>, ResBody>>::Request>>::Future, ResBody>
type Future = ResponseFuture<<T as Service<<U as Predicate<Request<ReqBody>, ResBody>>::Request>>::Future, ResBody>
The future response value.
sourceimpl<S, F, ReqBody, ResBody, Res, Fut, T1, T2, T3, T4, T5, T6, T7> Service<Request<ReqBody>> for HandleError<S, F, (T1, T2, T3, T4, T5, T6, T7)> where
S: 'static + Service<Request<ReqBody>, Response = Response<ResBody>> + Clone + Send,
F: 'static + FnOnce(T1, T2, T3, T4, T5, T6, T7, <S as Service<Request<ReqBody>>>::Error) -> Fut + Clone + Send,
Fut: Future<Output = Res> + Send,
Res: IntoResponse,
T1: FromRequest<ReqBody> + Send,
T2: FromRequest<ReqBody> + Send,
T3: FromRequest<ReqBody> + Send,
T4: FromRequest<ReqBody> + Send,
T5: FromRequest<ReqBody> + Send,
T6: FromRequest<ReqBody> + Send,
T7: FromRequest<ReqBody> + Send,
ReqBody: 'static + Send,
ResBody: 'static + Body<Data = Bytes> + Send,
<S as Service<Request<ReqBody>>>::Error: Send,
<S as Service<Request<ReqBody>>>::Future: Send,
<ResBody as Body>::Error: Into<Box<dyn Error + Sync + Send + 'static, Global>>,
impl<S, F, ReqBody, ResBody, Res, Fut, T1, T2, T3, T4, T5, T6, T7> Service<Request<ReqBody>> for HandleError<S, F, (T1, T2, T3, T4, T5, T6, T7)> where
S: 'static + Service<Request<ReqBody>, Response = Response<ResBody>> + Clone + Send,
F: 'static + FnOnce(T1, T2, T3, T4, T5, T6, T7, <S as Service<Request<ReqBody>>>::Error) -> Fut + Clone + Send,
Fut: Future<Output = Res> + Send,
Res: IntoResponse,
T1: FromRequest<ReqBody> + Send,
T2: FromRequest<ReqBody> + Send,
T3: FromRequest<ReqBody> + Send,
T4: FromRequest<ReqBody> + Send,
T5: FromRequest<ReqBody> + Send,
T6: FromRequest<ReqBody> + Send,
T7: FromRequest<ReqBody> + Send,
ReqBody: 'static + Send,
ResBody: 'static + Body<Data = Bytes> + Send,
<S as Service<Request<ReqBody>>>::Error: Send,
<S as Service<Request<ReqBody>>>::Future: Send,
<ResBody as Body>::Error: Into<Box<dyn Error + Sync + Send + 'static, Global>>,
type Response = Response<UnsyncBoxBody<Bytes, Error>>
type Response = Response<UnsyncBoxBody<Bytes, Error>>
Responses given by the service.
type Error = Infallible
type Error = Infallible
Errors produced by the service.
type Future = HandleErrorFuture
type Future = HandleErrorFuture
The future response value.
sourcefn poll_ready(
&mut self,
&mut Context<'_>
) -> Poll<Result<(), <HandleError<S, F, (T1, T2, T3, T4, T5, T6, T7)> as Service<Request<ReqBody>>>::Error>>
fn poll_ready(
&mut self,
&mut Context<'_>
) -> Poll<Result<(), <HandleError<S, F, (T1, T2, T3, T4, T5, T6, T7)> as Service<Request<ReqBody>>>::Error>>
Returns Poll::Ready(Ok(())) when the service is able to process requests. Read more
sourcefn call(
&mut self,
req: Request<ReqBody>
) -> <HandleError<S, F, (T1, T2, T3, T4, T5, T6, T7)> as Service<Request<ReqBody>>>::Future
fn call(
&mut self,
req: Request<ReqBody>
) -> <HandleError<S, F, (T1, T2, T3, T4, T5, T6, T7)> as Service<Request<ReqBody>>>::Future
Process the request and return the response asynchronously. Read more
sourceimpl<T, U, ReqBody, ResBody> Service<Request<ReqBody>> for AsyncFilterEx<T, U, ResBody> where
T: Service<<U as AsyncPredicate<Request<ReqBody>, ResBody>>::Request, Response = Response<ResBody>> + Clone,
U: AsyncPredicate<Request<ReqBody>, ResBody, Response = Response<ResBody>>,
impl<T, U, ReqBody, ResBody> Service<Request<ReqBody>> for AsyncFilterEx<T, U, ResBody> where
T: Service<<U as AsyncPredicate<Request<ReqBody>, ResBody>>::Request, Response = Response<ResBody>> + Clone,
U: AsyncPredicate<Request<ReqBody>, ResBody, Response = Response<ResBody>>,
type Response = <T as Service<<U as AsyncPredicate<Request<ReqBody>, ResBody>>::Request>>::Response
type Response = <T as Service<<U as AsyncPredicate<Request<ReqBody>, ResBody>>::Request>>::Response
Responses given by the service.
type Error = Either<<U as AsyncPredicate<Request<ReqBody>, ResBody>>::Response, <T as Service<<U as AsyncPredicate<Request<ReqBody>, ResBody>>::Request>>::Error>
type Error = Either<<U as AsyncPredicate<Request<ReqBody>, ResBody>>::Response, <T as Service<<U as AsyncPredicate<Request<ReqBody>, ResBody>>::Request>>::Error>
Errors produced by the service.
sourceimpl<S, F, ReqBody, ResBody, Fut, Res> Service<Request<ReqBody>> for HandleError<S, F, ()> where
S: 'static + Service<Request<ReqBody>, Response = Response<ResBody>> + Clone + Send,
F: 'static + FnOnce(<S as Service<Request<ReqBody>>>::Error) -> Fut + Clone + Send,
Fut: Future<Output = Res> + Send,
Res: IntoResponse,
ReqBody: 'static + Send,
ResBody: 'static + Body<Data = Bytes> + Send,
<S as Service<Request<ReqBody>>>::Error: Send,
<S as Service<Request<ReqBody>>>::Future: Send,
<ResBody as Body>::Error: Into<Box<dyn Error + Sync + Send + 'static, Global>>,
impl<S, F, ReqBody, ResBody, Fut, Res> Service<Request<ReqBody>> for HandleError<S, F, ()> where
S: 'static + Service<Request<ReqBody>, Response = Response<ResBody>> + Clone + Send,
F: 'static + FnOnce(<S as Service<Request<ReqBody>>>::Error) -> Fut + Clone + Send,
Fut: Future<Output = Res> + Send,
Res: IntoResponse,
ReqBody: 'static + Send,
ResBody: 'static + Body<Data = Bytes> + Send,
<S as Service<Request<ReqBody>>>::Error: Send,
<S as Service<Request<ReqBody>>>::Future: Send,
<ResBody as Body>::Error: Into<Box<dyn Error + Sync + Send + 'static, Global>>,
type Response = Response<UnsyncBoxBody<Bytes, Error>>
type Response = Response<UnsyncBoxBody<Bytes, Error>>
Responses given by the service.
type Error = Infallible
type Error = Infallible
Errors produced by the service.
type Future = HandleErrorFuture
type Future = HandleErrorFuture
The future response value.
sourceimpl<F, Fut, Out, S, ReqBody, ResBody> Service<Request<ReqBody>> for FromFn<F, S> where
F: FnMut(Request<ReqBody>, Next<ReqBody>) -> Fut,
Fut: Future<Output = Out>,
Out: IntoResponse,
S: 'static + Service<Request<ReqBody>, Response = Response<ResBody>, Error = Infallible> + Clone + Send,
ResBody: 'static + Body<Data = Bytes> + Send,
<S as Service<Request<ReqBody>>>::Future: 'static,
<S as Service<Request<ReqBody>>>::Future: Send,
<ResBody as Body>::Error: Into<Box<dyn Error + Sync + Send + 'static, Global>>,
impl<F, Fut, Out, S, ReqBody, ResBody> Service<Request<ReqBody>> for FromFn<F, S> where
F: FnMut(Request<ReqBody>, Next<ReqBody>) -> Fut,
Fut: Future<Output = Out>,
Out: IntoResponse,
S: 'static + Service<Request<ReqBody>, Response = Response<ResBody>, Error = Infallible> + Clone + Send,
ResBody: 'static + Body<Data = Bytes> + Send,
<S as Service<Request<ReqBody>>>::Future: 'static,
<S as Service<Request<ReqBody>>>::Future: Send,
<ResBody as Body>::Error: Into<Box<dyn Error + Sync + Send + 'static, Global>>,
type Response = Response<UnsyncBoxBody<Bytes, Error>>
type Response = Response<UnsyncBoxBody<Bytes, Error>>
Responses given by the service.
type Error = Infallible
type Error = Infallible
Errors produced by the service.
type Future = ResponseFuture<Fut>
type Future = ResponseFuture<Fut>
The future response value.
sourceimpl<S, F, ReqBody, ResBody, Res, Fut, T1, T2, T3, T4> Service<Request<ReqBody>> for HandleError<S, F, (T1, T2, T3, T4)> where
S: 'static + Service<Request<ReqBody>, Response = Response<ResBody>> + Clone + Send,
F: 'static + FnOnce(T1, T2, T3, T4, <S as Service<Request<ReqBody>>>::Error) -> Fut + Clone + Send,
Fut: Future<Output = Res> + Send,
Res: IntoResponse,
T1: FromRequest<ReqBody> + Send,
T2: FromRequest<ReqBody> + Send,
T3: FromRequest<ReqBody> + Send,
T4: FromRequest<ReqBody> + Send,
ReqBody: 'static + Send,
ResBody: 'static + Body<Data = Bytes> + Send,
<S as Service<Request<ReqBody>>>::Error: Send,
<S as Service<Request<ReqBody>>>::Future: Send,
<ResBody as Body>::Error: Into<Box<dyn Error + Sync + Send + 'static, Global>>,
impl<S, F, ReqBody, ResBody, Res, Fut, T1, T2, T3, T4> Service<Request<ReqBody>> for HandleError<S, F, (T1, T2, T3, T4)> where
S: 'static + Service<Request<ReqBody>, Response = Response<ResBody>> + Clone + Send,
F: 'static + FnOnce(T1, T2, T3, T4, <S as Service<Request<ReqBody>>>::Error) -> Fut + Clone + Send,
Fut: Future<Output = Res> + Send,
Res: IntoResponse,
T1: FromRequest<ReqBody> + Send,
T2: FromRequest<ReqBody> + Send,
T3: FromRequest<ReqBody> + Send,
T4: FromRequest<ReqBody> + Send,
ReqBody: 'static + Send,
ResBody: 'static + Body<Data = Bytes> + Send,
<S as Service<Request<ReqBody>>>::Error: Send,
<S as Service<Request<ReqBody>>>::Future: Send,
<ResBody as Body>::Error: Into<Box<dyn Error + Sync + Send + 'static, Global>>,
type Response = Response<UnsyncBoxBody<Bytes, Error>>
type Response = Response<UnsyncBoxBody<Bytes, Error>>
Responses given by the service.
type Error = Infallible
type Error = Infallible
Errors produced by the service.
type Future = HandleErrorFuture
type Future = HandleErrorFuture
The future response value.
sourcefn poll_ready(
&mut self,
&mut Context<'_>
) -> Poll<Result<(), <HandleError<S, F, (T1, T2, T3, T4)> as Service<Request<ReqBody>>>::Error>>
fn poll_ready(
&mut self,
&mut Context<'_>
) -> Poll<Result<(), <HandleError<S, F, (T1, T2, T3, T4)> as Service<Request<ReqBody>>>::Error>>
Returns Poll::Ready(Ok(())) when the service is able to process requests. Read more
sourcefn call(
&mut self,
req: Request<ReqBody>
) -> <HandleError<S, F, (T1, T2, T3, T4)> as Service<Request<ReqBody>>>::Future
fn call(
&mut self,
req: Request<ReqBody>
) -> <HandleError<S, F, (T1, T2, T3, T4)> as Service<Request<ReqBody>>>::Future
Process the request and return the response asynchronously. Read more
sourceimpl<S, F, ReqBody, ResBody, Res, Fut, T1> Service<Request<ReqBody>> for HandleError<S, F, (T1,)> where
S: 'static + Service<Request<ReqBody>, Response = Response<ResBody>> + Clone + Send,
F: 'static + FnOnce(T1, <S as Service<Request<ReqBody>>>::Error) -> Fut + Clone + Send,
Fut: Future<Output = Res> + Send,
Res: IntoResponse,
T1: FromRequest<ReqBody> + Send,
ReqBody: 'static + Send,
ResBody: 'static + Body<Data = Bytes> + Send,
<S as Service<Request<ReqBody>>>::Error: Send,
<S as Service<Request<ReqBody>>>::Future: Send,
<ResBody as Body>::Error: Into<Box<dyn Error + Sync + Send + 'static, Global>>,
impl<S, F, ReqBody, ResBody, Res, Fut, T1> Service<Request<ReqBody>> for HandleError<S, F, (T1,)> where
S: 'static + Service<Request<ReqBody>, Response = Response<ResBody>> + Clone + Send,
F: 'static + FnOnce(T1, <S as Service<Request<ReqBody>>>::Error) -> Fut + Clone + Send,
Fut: Future<Output = Res> + Send,
Res: IntoResponse,
T1: FromRequest<ReqBody> + Send,
ReqBody: 'static + Send,
ResBody: 'static + Body<Data = Bytes> + Send,
<S as Service<Request<ReqBody>>>::Error: Send,
<S as Service<Request<ReqBody>>>::Future: Send,
<ResBody as Body>::Error: Into<Box<dyn Error + Sync + Send + 'static, Global>>,
type Response = Response<UnsyncBoxBody<Bytes, Error>>
type Response = Response<UnsyncBoxBody<Bytes, Error>>
Responses given by the service.
type Error = Infallible
type Error = Infallible
Errors produced by the service.
type Future = HandleErrorFuture
type Future = HandleErrorFuture
The future response value.
sourceimpl<S, F, ReqBody, ResBody, Res, Fut, T1, T2, T3> Service<Request<ReqBody>> for HandleError<S, F, (T1, T2, T3)> where
S: 'static + Service<Request<ReqBody>, Response = Response<ResBody>> + Clone + Send,
F: 'static + FnOnce(T1, T2, T3, <S as Service<Request<ReqBody>>>::Error) -> Fut + Clone + Send,
Fut: Future<Output = Res> + Send,
Res: IntoResponse,
T1: FromRequest<ReqBody> + Send,
T2: FromRequest<ReqBody> + Send,
T3: FromRequest<ReqBody> + Send,
ReqBody: 'static + Send,
ResBody: 'static + Body<Data = Bytes> + Send,
<S as Service<Request<ReqBody>>>::Error: Send,
<S as Service<Request<ReqBody>>>::Future: Send,
<ResBody as Body>::Error: Into<Box<dyn Error + Sync + Send + 'static, Global>>,
impl<S, F, ReqBody, ResBody, Res, Fut, T1, T2, T3> Service<Request<ReqBody>> for HandleError<S, F, (T1, T2, T3)> where
S: 'static + Service<Request<ReqBody>, Response = Response<ResBody>> + Clone + Send,
F: 'static + FnOnce(T1, T2, T3, <S as Service<Request<ReqBody>>>::Error) -> Fut + Clone + Send,
Fut: Future<Output = Res> + Send,
Res: IntoResponse,
T1: FromRequest<ReqBody> + Send,
T2: FromRequest<ReqBody> + Send,
T3: FromRequest<ReqBody> + Send,
ReqBody: 'static + Send,
ResBody: 'static + Body<Data = Bytes> + Send,
<S as Service<Request<ReqBody>>>::Error: Send,
<S as Service<Request<ReqBody>>>::Future: Send,
<ResBody as Body>::Error: Into<Box<dyn Error + Sync + Send + 'static, Global>>,
type Response = Response<UnsyncBoxBody<Bytes, Error>>
type Response = Response<UnsyncBoxBody<Bytes, Error>>
Responses given by the service.
type Error = Infallible
type Error = Infallible
Errors produced by the service.
type Future = HandleErrorFuture
type Future = HandleErrorFuture
The future response value.
sourcefn poll_ready(
&mut self,
&mut Context<'_>
) -> Poll<Result<(), <HandleError<S, F, (T1, T2, T3)> as Service<Request<ReqBody>>>::Error>>
fn poll_ready(
&mut self,
&mut Context<'_>
) -> Poll<Result<(), <HandleError<S, F, (T1, T2, T3)> as Service<Request<ReqBody>>>::Error>>
Returns Poll::Ready(Ok(())) when the service is able to process requests. Read more
sourcefn call(
&mut self,
req: Request<ReqBody>
) -> <HandleError<S, F, (T1, T2, T3)> as Service<Request<ReqBody>>>::Future
fn call(
&mut self,
req: Request<ReqBody>
) -> <HandleError<S, F, (T1, T2, T3)> as Service<Request<ReqBody>>>::Future
Process the request and return the response asynchronously. Read more
sourceimpl<S, E, ReqBody, ResBody> Service<Request<ReqBody>> for FromExtractor<S, E> where
E: 'static + FromRequest<ReqBody>,
ReqBody: 'static + Default + Send,
S: Service<Request<ReqBody>, Response = Response<ResBody>> + Clone,
ResBody: 'static + Body<Data = Bytes> + Send,
<ResBody as Body>::Error: Into<Box<dyn Error + Sync + Send + 'static, Global>>,
impl<S, E, ReqBody, ResBody> Service<Request<ReqBody>> for FromExtractor<S, E> where
E: 'static + FromRequest<ReqBody>,
ReqBody: 'static + Default + Send,
S: Service<Request<ReqBody>, Response = Response<ResBody>> + Clone,
ResBody: 'static + Body<Data = Bytes> + Send,
<ResBody as Body>::Error: Into<Box<dyn Error + Sync + Send + 'static, Global>>,
type Response = Response<UnsyncBoxBody<Bytes, Error>>
type Response = Response<UnsyncBoxBody<Bytes, Error>>
Responses given by the service.
type Future = ResponseFuture<ReqBody, S, E>
type Future = ResponseFuture<ReqBody, S, E>
The future response value.
sourceimpl<S, F, ReqBody, ResBody, Res, Fut, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> Service<Request<ReqBody>> for HandleError<S, F, (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14)> where
S: 'static + Service<Request<ReqBody>, Response = Response<ResBody>> + Clone + Send,
F: 'static + FnOnce(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, <S as Service<Request<ReqBody>>>::Error) -> Fut + Clone + Send,
Fut: Future<Output = Res> + Send,
Res: IntoResponse,
T1: FromRequest<ReqBody> + Send,
T2: FromRequest<ReqBody> + Send,
T3: FromRequest<ReqBody> + Send,
T4: FromRequest<ReqBody> + Send,
T5: FromRequest<ReqBody> + Send,
T6: FromRequest<ReqBody> + Send,
T7: FromRequest<ReqBody> + Send,
T8: FromRequest<ReqBody> + Send,
T9: FromRequest<ReqBody> + Send,
T10: FromRequest<ReqBody> + Send,
T11: FromRequest<ReqBody> + Send,
T12: FromRequest<ReqBody> + Send,
T13: FromRequest<ReqBody> + Send,
T14: FromRequest<ReqBody> + Send,
ReqBody: 'static + Send,
ResBody: 'static + Body<Data = Bytes> + Send,
<S as Service<Request<ReqBody>>>::Error: Send,
<S as Service<Request<ReqBody>>>::Future: Send,
<ResBody as Body>::Error: Into<Box<dyn Error + Sync + Send + 'static, Global>>,
impl<S, F, ReqBody, ResBody, Res, Fut, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> Service<Request<ReqBody>> for HandleError<S, F, (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14)> where
S: 'static + Service<Request<ReqBody>, Response = Response<ResBody>> + Clone + Send,
F: 'static + FnOnce(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, <S as Service<Request<ReqBody>>>::Error) -> Fut + Clone + Send,
Fut: Future<Output = Res> + Send,
Res: IntoResponse,
T1: FromRequest<ReqBody> + Send,
T2: FromRequest<ReqBody> + Send,
T3: FromRequest<ReqBody> + Send,
T4: FromRequest<ReqBody> + Send,
T5: FromRequest<ReqBody> + Send,
T6: FromRequest<ReqBody> + Send,
T7: FromRequest<ReqBody> + Send,
T8: FromRequest<ReqBody> + Send,
T9: FromRequest<ReqBody> + Send,
T10: FromRequest<ReqBody> + Send,
T11: FromRequest<ReqBody> + Send,
T12: FromRequest<ReqBody> + Send,
T13: FromRequest<ReqBody> + Send,
T14: FromRequest<ReqBody> + Send,
ReqBody: 'static + Send,
ResBody: 'static + Body<Data = Bytes> + Send,
<S as Service<Request<ReqBody>>>::Error: Send,
<S as Service<Request<ReqBody>>>::Future: Send,
<ResBody as Body>::Error: Into<Box<dyn Error + Sync + Send + 'static, Global>>,
type Response = Response<UnsyncBoxBody<Bytes, Error>>
type Response = Response<UnsyncBoxBody<Bytes, Error>>
Responses given by the service.
type Error = Infallible
type Error = Infallible
Errors produced by the service.
type Future = HandleErrorFuture
type Future = HandleErrorFuture
The future response value.
sourcefn poll_ready(
&mut self,
&mut Context<'_>
) -> Poll<Result<(), <HandleError<S, F, (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14)> as Service<Request<ReqBody>>>::Error>>
fn poll_ready(
&mut self,
&mut Context<'_>
) -> Poll<Result<(), <HandleError<S, F, (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14)> as Service<Request<ReqBody>>>::Error>>
Returns Poll::Ready(Ok(())) when the service is able to process requests. Read more
sourcefn call(
&mut self,
req: Request<ReqBody>
) -> <HandleError<S, F, (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14)> as Service<Request<ReqBody>>>::Future
fn call(
&mut self,
req: Request<ReqBody>
) -> <HandleError<S, F, (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14)> as Service<Request<ReqBody>>>::Future
Process the request and return the response asynchronously. Read more
sourceimpl<ResBody, S, T> Service<Request<ResBody>> for AddExtension<S, T> where
S: Service<Request<ResBody>>,
T: 'static + Clone + Send + Sync,
impl<ResBody, S, T> Service<Request<ResBody>> for AddExtension<S, T> where
S: Service<Request<ResBody>>,
T: 'static + Clone + Send + Sync,
Auto Trait Implementations
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more