pub struct WebService<T, U, M>{ /* private fields */ }Expand description
The service defined by ServiceBuilder.
WebService contains the resources, routes, middleware, catch handlers, …
that were defined by the builder. It implements tower_service::Service,
which exposes an HTTP request / response API.
Trait Implementations§
Source§impl<T, U, M> Debug for WebService<T, U, M>where
T: Resource + Debug,
U: Catch + Debug,
M: HttpMiddleware<RoutedService<T, U>> + Debug,
M::Service: Debug,
M::RequestBody: Debug,
M::ResponseBody: Debug,
M::Error: Debug,
impl<T, U, M> Debug for WebService<T, U, M>where
T: Resource + Debug,
U: Catch + Debug,
M: HttpMiddleware<RoutedService<T, U>> + Debug,
M::Service: Debug,
M::RequestBody: Debug,
M::ResponseBody: Debug,
M::Error: Debug,
Source§impl<T, U, M> Service for WebService<T, U, M>
impl<T, U, M> Service for WebService<T, U, M>
Source§type Request = Request<<M as HttpMiddleware<RoutedService<T, U>>>::RequestBody>
type Request = Request<<M as HttpMiddleware<RoutedService<T, U>>>::RequestBody>
Requests handled by the service.
Source§type Response = Response<<M as HttpMiddleware<RoutedService<T, U>>>::ResponseBody>
type Response = Response<<M as HttpMiddleware<RoutedService<T, U>>>::ResponseBody>
Responses given by the service.
Source§type Error = <M as HttpMiddleware<RoutedService<T, U>>>::Error
type Error = <M as HttpMiddleware<RoutedService<T, U>>>::Error
Errors produced by the service.
Source§type Future = <<M as HttpMiddleware<RoutedService<T, U>>>::Service as HttpService>::Future
type Future = <<M as HttpMiddleware<RoutedService<T, U>>>::Service as HttpService>::Future
The future response value.
Source§fn poll_ready(&mut self) -> Poll<(), Self::Error>
fn poll_ready(&mut self) -> Poll<(), Self::Error>
Returns
Ready when the service is able to process requests. Read moreAuto Trait Implementations§
impl<T, U, M> Freeze for WebService<T, U, M>
impl<T, U, M> RefUnwindSafe for WebService<T, U, M>
impl<T, U, M> Send for WebService<T, U, M>
impl<T, U, M> Sync for WebService<T, U, M>
impl<T, U, M> Unpin for WebService<T, U, M>
impl<T, U, M> UnwindSafe for WebService<T, U, M>
Blanket Implementations§
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
Mutably borrows from an owned value. Read more
Source§impl<T, B1, B2> HttpService for T
impl<T, B1, B2> HttpService for T
Source§type RequestBody = B1
type RequestBody = B1
Request payload.
Source§type ResponseBody = B2
type ResponseBody = B2
The HTTP response body type.
Source§fn poll_http_ready(&mut self) -> Result<Async<()>, <T as Service>::Error>
fn poll_http_ready(&mut self) -> Result<Async<()>, <T as Service>::Error>
Returns
Ready when the service is able to process requests.Source§fn call_http(
&mut self,
request: Request<<T as HttpService>::RequestBody>,
) -> <T as HttpService>::Future
fn call_http( &mut self, request: Request<<T as HttpService>::RequestBody>, ) -> <T as HttpService>::Future
Process the request and return the response asynchronously.
Source§fn lift(self) -> LiftService<Self>where
Self: Sized,
fn lift(self) -> LiftService<Self>where
Self: Sized,
Wraps
self with LiftService. This provides an implementation of
Service for 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>
Converts
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>
Converts
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