IntoUpdateHandlerFunc

Trait IntoUpdateHandlerFunc 

Source
pub trait IntoUpdateHandlerFunc<Arg, Res> {
    // Required method
    fn into_update_handler_fn(
        self,
    ) -> Box<dyn FnMut(UpdateContext, &Payload) -> BoxFuture<'static, Result<Payload, Error>> + Send>;
}
Expand description

Closures / functions which can be turned into update handler functions implement this trait

Required Methods§

Source

fn into_update_handler_fn( self, ) -> Box<dyn FnMut(UpdateContext, &Payload) -> BoxFuture<'static, Result<Payload, Error>> + Send>

Consume the closure/fn pointer and turn it into an update handler

Implementors§

Source§

impl<A, F, Rf, R> IntoUpdateHandlerFunc<A, R> for F
where A: FromJsonPayloadExt + Send, F: FnMut(UpdateContext, A) -> Rf + Send + 'static, Rf: Future<Output = Result<R, Error>> + Send + 'static, R: AsJsonPayloadExt,