pub struct TypedHandler<F, T, Fut>where
F: Fn(T, RequestContext) -> Fut + Send + Sync + 'static,
T: DeserializeOwned + Send + 'static,
Fut: Future<Output = HandlerResult> + Send + 'static,{ /* private fields */ }Expand description
Wrapper that deserializes payload before calling the handler.
Implementations§
Source§impl<F, T, Fut> TypedHandler<F, T, Fut>where
F: Fn(T, RequestContext) -> Fut + Send + Sync + 'static,
T: DeserializeOwned + Send + 'static,
Fut: Future<Output = HandlerResult> + Send + 'static,
impl<F, T, Fut> TypedHandler<F, T, Fut>where
F: Fn(T, RequestContext) -> Fut + Send + Sync + 'static,
T: DeserializeOwned + Send + 'static,
Fut: Future<Output = HandlerResult> + Send + 'static,
Trait Implementations§
Source§impl<F, T, Fut> Handler for TypedHandler<F, T, Fut>where
F: Fn(T, RequestContext) -> Fut + Send + Sync + 'static,
T: DeserializeOwned + Send + 'static,
Fut: Future<Output = HandlerResult> + Send + 'static,
impl<F, T, Fut> Handler for TypedHandler<F, T, Fut>where
F: Fn(T, RequestContext) -> Fut + Send + Sync + 'static,
T: DeserializeOwned + Send + 'static,
Fut: Future<Output = HandlerResult> + Send + 'static,
Source§fn call(
&self,
data: &[u8],
ctx: RequestContext,
) -> BoxFuture<'static, HandlerResult>
fn call( &self, data: &[u8], ctx: RequestContext, ) -> BoxFuture<'static, HandlerResult>
Handle a request with raw payload bytes.
Auto Trait Implementations§
impl<F, T, Fut> Freeze for TypedHandler<F, T, Fut>where
F: Freeze,
impl<F, T, Fut> RefUnwindSafe for TypedHandler<F, T, Fut>where
F: RefUnwindSafe,
impl<F, T, Fut> Send for TypedHandler<F, T, Fut>
impl<F, T, Fut> Sync for TypedHandler<F, T, Fut>
impl<F, T, Fut> Unpin for TypedHandler<F, T, Fut>where
F: Unpin,
impl<F, T, Fut> UnwindSafe for TypedHandler<F, T, Fut>where
F: 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