RequestHandler

Trait RequestHandler 

Source
pub trait RequestHandler<Endpoint>: DynClone + 'static {
    // Required method
    fn handle<'life0, 'async_trait>(
        &'life0 self,
        request: Request<Endpoint>,
    ) -> Pin<Box<dyn Future<Output = Result<Response, CoapError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}

Required Methods§

Source

fn handle<'life0, 'async_trait>( &'life0 self, request: Request<Endpoint>, ) -> Pin<Box<dyn Future<Output = Result<Response, CoapError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Implementors§

Source§

impl<Endpoint, F, R> RequestHandler<Endpoint> for F
where Endpoint: Send + Sync + 'static, F: Fn(Request<Endpoint>) -> R + Sync + Send + Clone + 'static, R: Future<Output = Result<Response, CoapError>> + Send,