Trait HttpServerHandler

Source
pub trait HttpServerHandler:
    Sync
    + Send
    + 'static {
    type Body: Body<Data: Send + Sync, Error: Into<Box<dyn Error + Send + Sync>>> + Send;

    // Required method
    fn handle_request(
        self: Arc<Self>,
        source: IpAddr,
        request: Request<Incoming>,
    ) -> impl Future<Output = Response<Self::Body>> + Send;
}

Required Associated Types§

Source

type Body: Body<Data: Send + Sync, Error: Into<Box<dyn Error + Send + Sync>>> + Send

Required Methods§

Source

fn handle_request( self: Arc<Self>, source: IpAddr, request: Request<Incoming>, ) -> impl Future<Output = Response<Self::Body>> + Send

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§