pub struct TowerHandler<Req, State, Res> {
pub service: BoxCloneService<Bundle<Req, State, Res>, Bundle<Req, State, Res>, Infallible>,
pub priority: u8,
pub name: &'static str,
pub module_name: &'static str,
}Expand description
A type-erased handler backed by a tower Service.
The most feature-complete and the slowest wrapper: it inserts a tower Service
layer (HandlerService), a boxed future (HandlerServiceFuture), and a
BoxCloneService, so every call pays for several layers of boxing and a
oneshot dispatch.
Fields§
§service: BoxCloneService<Bundle<Req, State, Res>, Bundle<Req, State, Res>, Infallible>The boxed tower service.
priority: u8The handler’s priority.
name: &'static strThe handler’s name.
module_name: &'static strThe module the handler was registered from.
Implementations§
Source§impl<Req, State, Res> TowerHandler<Req, State, Res>
impl<Req, State, Res> TowerHandler<Req, State, Res>
Trait Implementations§
Source§impl<Req, State, Res> Call<Req, State, Res> for TowerHandler<Req, State, Res>
impl<Req, State, Res> Call<Req, State, Res> for TowerHandler<Req, State, Res>
Source§impl<Req, State, Res> Clone for TowerHandler<Req, State, Res>
impl<Req, State, Res> Clone for TowerHandler<Req, State, Res>
Source§impl<Req, State, Res> Service<Bundle<Req, State, Res>> for TowerHandler<Req, State, Res>
impl<Req, State, Res> Service<Bundle<Req, State, Res>> for TowerHandler<Req, State, Res>
impl<Req, State, Res> Sync for TowerHandler<Req, State, Res>
Auto Trait Implementations§
impl<Req, State, Res> !RefUnwindSafe for TowerHandler<Req, State, Res>
impl<Req, State, Res> !UnwindSafe for TowerHandler<Req, State, Res>
impl<Req, State, Res> Freeze for TowerHandler<Req, State, Res>
impl<Req, State, Res> Send for TowerHandler<Req, State, Res>
impl<Req, State, Res> Unpin for TowerHandler<Req, State, Res>
impl<Req, State, Res> UnsafeUnpin for TowerHandler<Req, State, Res>
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
impl<T> CloneAny for T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoResponse<T> for Twhere
T: Send,
impl<T> IntoResponse<T> for Twhere
T: Send,
Source§fn into_response(self) -> T
fn into_response(self) -> T
Convert this value into a response.
Source§impl<T, Request> ServiceExt<Request> for T
impl<T, Request> ServiceExt<Request> for T
Source§fn ready(&mut self) -> Ready<'_, Self, Request> ⓘwhere
Self: Sized,
fn ready(&mut self) -> Ready<'_, Self, Request> ⓘwhere
Self: Sized,
Yields a mutable reference to the service when it is ready to accept a request.
Source§fn ready_oneshot(self) -> ReadyOneshot<Self, Request> ⓘwhere
Self: Sized,
fn ready_oneshot(self) -> ReadyOneshot<Self, Request> ⓘwhere
Self: Sized,
Yields the service when it is ready to accept a request.
Source§fn oneshot(self, req: Request) -> Oneshot<Self, Request> ⓘwhere
Self: Sized,
fn oneshot(self, req: Request) -> Oneshot<Self, Request> ⓘwhere
Self: Sized,
Consume this
Service, calling it with the provided request once it is ready.Source§fn and_then<F>(self, f: F) -> AndThen<Self, F>
fn and_then<F>(self, f: F) -> AndThen<Self, F>
Executes a new future after this service’s future resolves. This does
not alter the behaviour of the
poll_ready method. Read moreSource§fn map_response<F, Response>(self, f: F) -> MapResponse<Self, F>
fn map_response<F, Response>(self, f: F) -> MapResponse<Self, F>
Maps this service’s response value to a different value. This does not
alter the behaviour of the
poll_ready method. Read moreSource§fn map_err<F, Error>(self, f: F) -> MapErr<Self, F>
fn map_err<F, Error>(self, f: F) -> MapErr<Self, F>
Maps this service’s error value to a different value. This does not
alter the behaviour of the
poll_ready method. Read moreSource§fn map_result<F, Response, Error>(self, f: F) -> MapResult<Self, F>
fn map_result<F, Response, Error>(self, f: F) -> MapResult<Self, F>
Maps this service’s result type (
Result<Self::Response, Self::Error>)
to a different value, regardless of whether the future succeeds or
fails. Read moreSource§fn map_request<F, NewRequest>(self, f: F) -> MapRequest<Self, F>
fn map_request<F, NewRequest>(self, f: F) -> MapRequest<Self, F>
Composes a function in front of the service. Read more
Source§fn then<F, Response, Error, Fut>(self, f: F) -> Then<Self, F>
fn then<F, Response, Error, Fut>(self, f: F) -> Then<Self, F>
Composes an asynchronous function after this service. Read more
Source§fn map_future<F, Fut, Response, Error>(self, f: F) -> MapFuture<Self, F>
fn map_future<F, Fut, Response, Error>(self, f: F) -> MapFuture<Self, F>
Composes a function that transforms futures produced by the service. Read more