Skip to main content

HttpService

Trait HttpService 

Source
pub trait HttpService:
    Clone
    + Send
    + Sync
    + 'static {
    type Error: StdError + Send + Sync + 'static;

    // Required method
    fn send(
        &self,
        request: Request<Body>,
    ) -> impl Future<Output = Result<HyperResponse<Incoming>, Self::Error>> + Send;
}
Expand description

A cloneable Hyper-compatible request service.

Required Associated Types§

Source

type Error: StdError + Send + Sync + 'static

Required Methods§

Source

fn send( &self, request: Request<Body>, ) -> impl Future<Output = Result<HyperResponse<Incoming>, Self::Error>> + Send

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl HttpService for StandardService

Source§

impl<S> HttpService for S
where S: Service<Request<Body>, Response = Response<Incoming>> + Clone + Send + Sync + 'static, S::Error: StdError + Send + Sync + 'static, S::Future: Send,