[][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 + Send + 'static,
    B: Payload + 'static, 
[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) -> Poll<(), Error>[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<Item = Parts<T>, Error = Error>[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 + Send + 'static,
    B: Payload + 'static, 
[src]

type Item = ()

The type of value that this future will resolved with if it is successful. Read more

type Error = Error

The type of error that this future will resolve with if it fails in a normal fashion. Read more

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
    B: Unpin,
    T: Unpin,
    <B as Payload>::Data: Buf + Unpin

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

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

impl<T, B> !RefUnwindSafe 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<F> IntoFuture for F where
    F: Future
[src]

type Future = F

The future that this type can be converted into.

type Item = <F as Future>::Item

The item that the future may resolve with.

type Error = <F as Future>::Error

The error that the future may resolve with.

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