HttpServer

Trait HttpServer 

Source
pub trait HttpServer {
    // Required method
    fn serve<'async_trait>(
        router: Router,
        config: ServerConfig,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>;
}
Expand description

Trait for creating and starting HTTP servers

Required Methods§

Source

fn serve<'async_trait>( router: Router, config: ServerConfig, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>

Start the server with the given router and config

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§