Struct axum_extra::handler::IntoHandler
source · pub struct IntoHandler<H, T, S> { /* private fields */ }
Expand description
A Handler
created from a HandlerCallWithExtractors
.
Created with HandlerCallWithExtractors::into_handler
.
Trait Implementations§
source§impl<H, T, S> Clone for IntoHandler<H, T, S>where
H: Clone,
impl<H, T, S> Clone for IntoHandler<H, T, S>where
H: Clone,
source§impl<H, T, S> Handler<T, S> for IntoHandler<H, T, S>where
H: HandlerCallWithExtractors<T, S> + Clone + Send + 'static,
T: FromRequest<S> + Send + 'static,
T::Rejection: Send,
S: Send + Sync + 'static,
impl<H, T, S> Handler<T, S> for IntoHandler<H, T, S>where
H: HandlerCallWithExtractors<T, S> + Clone + Send + 'static,
T: FromRequest<S> + Send + 'static,
T::Rejection: Send,
S: Send + Sync + 'static,
§type Future = Pin<Box<dyn Future<Output = Response<Body>> + Send>>
type Future = Pin<Box<dyn Future<Output = Response<Body>> + Send>>
The type of future calling this handler returns.
source§fn call(self, req: Request, state: S) -> Self::Future
fn call(self, req: Request, state: S) -> Self::Future
Call the handler with the given request.
source§fn layer<L>(self, layer: L) -> Layered<L, Self, T, S>where
L: Layer<HandlerService<Self, T, S>> + Clone,
<L as Layer<HandlerService<Self, T, S>>>::Service: Service<Request<Body>>,
fn layer<L>(self, layer: L) -> Layered<L, Self, T, S>where
L: Layer<HandlerService<Self, T, S>> + Clone,
<L as Layer<HandlerService<Self, T, S>>>::Service: Service<Request<Body>>,
Apply a
tower::Layer
to the handler. Read moresource§fn with_state(self, state: S) -> HandlerService<Self, T, S>
fn with_state(self, state: S) -> HandlerService<Self, T, S>
Convert the handler into a
Service
by providing the stateimpl<H, T, S> Copy for IntoHandler<H, T, S>where
H: Copy,
Auto Trait Implementations§
impl<H, T, S> Freeze for IntoHandler<H, T, S>where
H: Freeze,
impl<H, T, S> RefUnwindSafe for IntoHandler<H, T, S>where
H: RefUnwindSafe,
impl<H, T, S> Send for IntoHandler<H, T, S>where
H: Send,
impl<H, T, S> Sync for IntoHandler<H, T, S>where
H: Sync,
impl<H, T, S> Unpin for IntoHandler<H, T, S>where
H: Unpin,
impl<H, T, S> UnwindSafe for IntoHandler<H, T, S>where
H: UnwindSafe,
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<H, T> HandlerWithoutStateExt<T> for H
impl<H, T> HandlerWithoutStateExt<T> for H
source§fn into_service(self) -> HandlerService<H, T, ()>
fn into_service(self) -> HandlerService<H, T, ()>
Convert the handler into a
Service
and no state.source§fn into_make_service(self) -> IntoMakeService<HandlerService<H, T, ()>>
fn into_make_service(self) -> IntoMakeService<HandlerService<H, T, ()>>
Convert the handler into a
MakeService
and no state. Read moresource§fn into_make_service_with_connect_info<C>(
self,
) -> IntoMakeServiceWithConnectInfo<HandlerService<H, T, ()>, C>
fn into_make_service_with_connect_info<C>( self, ) -> IntoMakeServiceWithConnectInfo<HandlerService<H, T, ()>, C>
Convert the handler into a
MakeService
which stores information
about the incoming connection and has no state. Read more