pub struct HandlerFnAdapter<Marker, H> { /* private fields */ }Expand description
Adapter that wraps a marker-disambiguated HandlerFn closure into a real
Handler.
This is the bridge that lets the boxed / router APIs accept extractor
closures: the closure is wrapped here, then boxed. The Marker type
parameter only encodes the closure’s argument shape (so per-arity impls stay
disjoint) and is erased once wrapped, so it never escapes into
BoxHandler. You normally obtain one via IntoHandler::into_handler
rather than naming it directly.
Trait Implementations§
Source§impl<Marker, H> Handler for HandlerFnAdapter<Marker, H>where
Marker: 'static,
H: HandlerFn<Marker>,
impl<Marker, H> Handler for HandlerFnAdapter<Marker, H>where
Marker: 'static,
H: HandlerFn<Marker>,
Source§fn handle(&self, call: Call) -> HandlerFuture
fn handle(&self, call: Call) -> HandlerFuture
Handle the call, returning a future that resolves to the response.
Auto Trait Implementations§
impl<Marker, H> Freeze for HandlerFnAdapter<Marker, H>where
H: Freeze,
impl<Marker, H> RefUnwindSafe for HandlerFnAdapter<Marker, H>where
H: RefUnwindSafe,
impl<Marker, H> Send for HandlerFnAdapter<Marker, H>where
H: Send,
impl<Marker, H> Sync for HandlerFnAdapter<Marker, H>where
H: Sync,
impl<Marker, H> Unpin for HandlerFnAdapter<Marker, H>where
H: Unpin,
impl<Marker, H> UnsafeUnpin for HandlerFnAdapter<Marker, H>where
H: UnsafeUnpin,
impl<Marker, H> UnwindSafe for HandlerFnAdapter<Marker, H>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