[][src]Trait izanami_http::upgrade::HttpUpgrade

pub trait HttpUpgrade<I> {
    type Upgraded: Connection<Error = Self::Error>;
    type Error;
    fn upgrade(self, stream: I) -> Result<Self::Upgraded, I>;
}

A trait that represents HTTP protocol upgrade.

Associated Types

type Upgraded: Connection<Error = Self::Error>

The type of asynchronous process that drives upgraded protocol.

type Error

The error type that will be returned from the upgraded stream.

Loading content...

Required methods

fn upgrade(self, stream: I) -> Result<Self::Upgraded, I>

Upgrades the specified stream to another protocol.

When the value cannot upgrade the stream, the implementation of this method should return a Err(stream) to properly shut down the stream.

Loading content...

Implementors

impl<Bd, I> HttpUpgrade<I> for Bd where
    Bd: BufStream
[src]

type Upgraded = Empty<(), Error>

type Error = Error

impl<I> HttpUpgrade<I> for Body[src]

type Upgraded = Empty<(), Self::Error>

type Error = Error

impl<T, I> HttpUpgrade<I> for NoUpgrade<T> where
    T: HttpBody
[src]

type Upgraded = Empty<(), Error>

type Error = Error

impl<T, U, I> HttpUpgrade<I> for MaybeUpgrade<T, U> where
    T: HttpBody,
    U: HttpUpgrade<I>, 
[src]

type Upgraded = U::Upgraded

type Error = U::Error

Loading content...