Skip to main content

HttpFuture

Trait HttpFuture 

Source
pub trait HttpFuture: Sealed {
    type Body;

    // Required method
    fn poll_http(&mut self) -> Poll<Response<Self::Body>, Error>;

    // Provided method
    fn lift(self) -> LiftFuture<Self>
       where Self: Sized { ... }
}
Expand description

HTTP response future trait

A trait “alias” for Future where the yielded item is an http::Response.

Using HttpFuture in where bounds is easier than trying to use Future directly.

Required Associated Types§

Source

type Body

The HTTP response body

Required Methods§

Source

fn poll_http(&mut self) -> Poll<Response<Self::Body>, Error>

Attempt to resolve the future to a final value, registering the current task for wakeup if the value is not yet available.

Provided Methods§

Source

fn lift(self) -> LiftFuture<Self>
where Self: Sized,

Wraps self with LiftFuture. This provides an implementation of Future for Self.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl<T, B> HttpFuture for T
where T: Future<Item = Response<B>, Error = Error>,

Source§

type Body = B