Handler

Trait Handler 

Source
pub trait Handler<T>:
    Clone
    + Send
    + Sync
    + 'static {
    // Required method
    fn into_handler(self) -> HandlerFn;
}
Expand description

A handler that can be converted to a HandlerFn

Required Methods§

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl Handler<()> for StaticFileHandler

Create a function-based handler for static files

Source§

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

Implementation for async functions that take a Request and return Result