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

#[must_use = "futures do nothing unless polled"]
pub struct Connection<I, S> where
    S: HyperService,
    S::ResponseBody: Stream<Error = Error>,
    <S::ResponseBody as Stream>::Item: AsRef<[u8]>, 
{ /* fields omitted */ }

A future binding a connection with a Service.

Polling this future will drive HTTP forward.

Methods

impl<I, B, S> Connection<I, S> where
    S: Service<Request = Request, Response = Response<B>, Error = Error> + 'static,
    I: AsyncRead + AsyncWrite + 'static,
    B: Stream<Error = Error> + 'static,
    B::Item: AsRef<[u8]>, 
[src]

pub fn disable_keep_alive(&mut self)[src]

Disables keep-alive for this connection.

pub fn into_parts(self) -> Parts<I, S>[src]

Return the inner IO object, and additional information.

This should only be called after poll_without_shutdown signals that the connection is "done". Otherwise, it may not have finished flushing all necessary HTTP bytes.

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.

Trait Implementations

impl<I, S> Debug for Connection<I, S> where
    S: HyperService,
    S::ResponseBody: Stream<Error = Error>,
    <S::ResponseBody as Stream>::Item: AsRef<[u8]>, 
[src]

impl<I, B, S> Future for Connection<I, S> where
    S: Service<Request = Request, Response = Response<B>, Error = Error> + 'static,
    I: AsyncRead + AsyncWrite + 'static,
    B: Stream<Error = Error> + 'static,
    B::Item: AsRef<[u8]>, 
[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<I, S> !RefUnwindSafe for Connection<I, S>

impl<I, S> Send for Connection<I, S> where
    I: Send,
    S: Send,
    <S as Service>::Future: Send,
    <<S as HyperService>::ResponseBody as Stream>::Item: Send,
    <S as HyperService>::ResponseBody: Send

impl<I, S> Sync for Connection<I, S> where
    I: Sync,
    S: Sync,
    <S as Service>::Future: Sync,
    <<S as HyperService>::ResponseBody as Stream>::Item: Sync,
    <S as HyperService>::ResponseBody: Sync

impl<I, S> Unpin for Connection<I, S> where
    I: Unpin,
    S: Unpin,
    <S as Service>::Future: Unpin,
    <<S as HyperService>::ResponseBody as Stream>::Item: Unpin,
    <S as HyperService>::ResponseBody: Unpin

impl<I, S> !UnwindSafe for Connection<I, S>

Blanket Implementations

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

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

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

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

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

impl<T, U> Into<U> for T where
    U: From<T>, 
[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, 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.