[][src]Struct hyper::client::conn::Connection

#[must_use = "futures do nothing unless polled"]
pub struct Connection<T, B> where
    T: AsyncRead + AsyncWrite + Send + 'static,
    B: Payload + 'static, 
{ /* fields omitted */ }

A future that processes all HTTP state for the IO object.

In most cases, this should just be spawned into an executor, so that it can process incoming and outgoing messages, notice hangups, and the like.

Methods

impl<T, B> Connection<T, B> where
    T: AsyncRead + AsyncWrite + Unpin + Send + 'static,
    B: Payload + Unpin + 'static,
    B::Data: Unpin
[src]

pub fn into_parts(self) -> Parts<T>[src]

Return the inner IO object, and additional information.

Only works for HTTP/1 connections. HTTP/2 connections will panic.

pub fn poll_without_shutdown(&mut self, cx: &mut Context) -> Poll<Result<()>>[src]

Poll the connection for completion, but without calling shutdown on the underlying IO.

This is useful to allow running a connection while doing an HTTP upgrade. Once the upgrade is completed, the connection would be "done", but it is not desired to actally shutdown the IO object. Instead you would take it back using into_parts.

Use poll_fn and try_ready! to work with this function; or use the without_shutdown wrapper.

pub fn without_shutdown(self) -> impl Future<Output = Result<Parts<T>>>[src]

Prevent shutdown of the underlying IO object at the end of service the request, instead run into_parts. This is a convenience wrapper over poll_without_shutdown.

Trait Implementations

impl<T, B> Debug for Connection<T, B> where
    T: AsyncRead + AsyncWrite + Debug + Send + 'static,
    B: Payload + 'static, 
[src]

impl<T, B> Future for Connection<T, B> where
    T: AsyncRead + AsyncWrite + Unpin + Send + 'static,
    B: Payload + Unpin + 'static,
    B::Data: Unpin
[src]

type Output = Result<()>

The type of value produced on completion.

Auto Trait Implementations

impl<T, B> Send for Connection<T, B> where
    <B as Payload>::Data: Buf + Send

impl<T, B> Unpin for Connection<T, B> where
    T: Unpin,
    <B as Payload>::Data: Buf

impl<T, B> Sync for Connection<T, B> where
    B: Sync,
    T: Sync,
    <B as Payload>::Data: Buf + Send + Sync

impl<T, B> !RefUnwindSafe for Connection<T, B>

impl<T, B> !UnwindSafe for Connection<T, B>

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> FutureExt for T where
    T: Future + ?Sized
[src]

impl<Fut> TryFutureExt for Fut where
    Fut: TryFuture + ?Sized
[src]

impl<F, T, E> TryFuture for F where
    F: Future<Output = Result<T, E>> + ?Sized
[src]

type Ok = T

The type of successful values yielded by this future

type Error = E

The type of failures yielded by this future