Trait hyperdriver::service::ServiceRef

source ·
pub trait ServiceRef<IO>: Sealed<IO> {
    type Future: Future<Output = Result<Self::Response, Self::Error>>;
    type Response;
    type Error;

    // Required method
    fn call(&mut self, stream: &IO) -> Self::Future;
}
Expand description

A tower::Service which takes a reference to a conenction type, usually in a “make service” context. Effectively this is Service<&IO>, but gets around the limitations of an impl with lifetimes.

Required Associated Types§

source

type Future: Future<Output = Result<Self::Response, Self::Error>>

The future returned by the service.

source

type Response

The response type of the service.

source

type Error

The error type of the service.

Required Methods§

source

fn call(&mut self, stream: &IO) -> Self::Future

Call the service with a reference to the connection.

Implementors§

source§

impl<IO, T, F, R, E> ServiceRef<IO> for T
where T: for<'a> Service<&'a IO, Future = F, Response = R, Error = E>, F: Future<Output = Result<R, E>>,

§

type Future = F

§

type Response = R

§

type Error = E