[][src]Enum izanami_http::upgrade::MaybeUpgrade

pub enum MaybeUpgrade<T: HttpBody, U> {
    Data(T),
    Upgrade(U),
}

An HttpUpgrade that contains either of an HttpBody or HttpUpgrade.

Variants

Data(T)

The body will be sent to the client without upgrading.

Upgrade(U)

The body will be upgraded.

Trait Implementations

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

type Data = T::Data

The type of bytes generated by this body.

type Error = T::Error

The error type that will be returned from this body.

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

type Upgraded = U::Upgraded

The type of asynchronous process that drives upgraded protocol.

type Error = U::Error

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

impl<T: Debug + HttpBody, U: Debug> Debug for MaybeUpgrade<T, U>[src]

Auto Trait Implementations

impl<T, U> Send for MaybeUpgrade<T, U> where
    T: Send,
    U: Send

impl<T, U> Sync for MaybeUpgrade<T, U> where
    T: Sync,
    U: Sync

Blanket Implementations

impl<T> HttpBody for T where
    T: BufStream
[src]

type Data = <T as BufStream>::Item

The type of bytes generated by this body.

type Error = <T as BufStream>::Error

The error type that will be returned from this body.

fn content_length(&self) -> Option<u64>[src]

Returns the length of total bytes contained in this body.

impl<T> HttpBodyExt for T where
    T: HttpBody
[src]

fn into_buf_stream(self) -> IntoBufStream<Self> where
    Self: Sized
[src]

Lift this body into a BufStream.

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

type Upgraded = Empty<(), Error>

The type of asynchronous process that drives upgraded protocol.

type Error = Error

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

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

impl<T> From for T[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

impl<T, U> TryInto 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> Any for T where
    T: 'static + ?Sized
[src]