Handler

Trait Handler 

Source
pub trait Handler: Send + Sync {
    // Required method
    fn call(
        &self,
    ) -> Pin<Box<dyn Future<Output = Result<String, String>> + Send + '_>>;
}
Expand description

Handler trait for protocol-agnostic request handling

Handlers implement this trait to provide a unified interface that can be called from any protocol adapter.

Required Methods§

Source

fn call( &self, ) -> Pin<Box<dyn Future<Output = Result<String, String>> + Send + '_>>

Call the handler and return a result

Implementors§

Source§

impl<F, Fut> Handler for HandlerFn<F, Fut>
where F: Fn() -> Fut + Send + Sync + 'static, Fut: Future<Output = String> + Send + 'static,