pub struct Layered<L, H, T, S> { /* private fields */ }Expand description
A handler wrapped with a Tower layer for middleware.
This type is returned by Handler::layer and implements Handler
itself, allowing you to compose multiple layers or pass it to
[Router::route].
Trait Implementations§
Source§impl<L, H, T, S> Handler<T, S> for Layered<L, H, T, S>
impl<L, H, T, S> Handler<T, S> for Layered<L, H, T, S>
Source§type Future = Pin<Box<dyn Future<Output = ()> + Send>>
type Future = Pin<Box<dyn Future<Output = ()> + Send>>
The future returned by calling this handler.
Source§type Signal = <H as Handler<T, S>>::Signal
type Signal = <H as Handler<T, S>>::Signal
The specific RINF signal type this handler processes.
Source§fn call(self, signal: Self::Signal, state: S) -> Self::Future
fn call(self, signal: Self::Signal, state: S) -> Self::Future
Call the handler with the given signal and state.
Source§fn layer<L>(self, layer: L) -> Layered<L, Self, T, S>
fn layer<L>(self, layer: L) -> Layered<L, Self, T, S>
Apply a Tower layer to this handler, creating a new layered handler.
Source§fn with_state(self, state: S) -> HandlerService<Self, T, S>
fn with_state(self, state: S) -> HandlerService<Self, T, S>
Convert this handler into a Tower Service with state.
This creates a HandlerService wrapper around the handler.
Auto Trait Implementations§
impl<L, H, T, S> Freeze for Layered<L, H, T, S>
impl<L, H, T, S> RefUnwindSafe for Layered<L, H, T, S>
impl<L, H, T, S> Send for Layered<L, H, T, S>
impl<L, H, T, S> Sync for Layered<L, H, T, S>
impl<L, H, T, S> Unpin for Layered<L, H, T, S>
impl<L, H, T, S> UnsafeUnpin for Layered<L, H, T, S>
impl<L, H, T, S> UnwindSafe for Layered<L, H, T, S>
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<H, T> HandlerWithoutStateExt<T> for H
impl<H, T> HandlerWithoutStateExt<T> for H
Source§fn into_service(self) -> HandlerService<Self, T, ()>
fn into_service(self) -> HandlerService<Self, T, ()>
Convert this handler into a service without requiring state.