Struct salvo::hyper::upgrade::Upgraded[]

pub struct Upgraded { /* fields omitted */ }

An upgraded HTTP connection.

This type holds a trait object internally of the original IO that was used to speak HTTP before the upgrade. It can be used directly as a Read or Write for convenience.

Alternatively, if the exact type is known, this can be deconstructed into its parts.

Implementations

impl Upgraded

pub fn downcast<T>(self) -> Result<Parts<T>, Upgraded> where
    T: 'static + AsyncRead + AsyncWrite + Unpin

Tries to downcast the internal trait object to the type passed.

On success, returns the downcasted parts. On error, returns the Upgraded back.

Trait Implementations

impl AsyncRead for Upgraded

impl AsyncWrite for Upgraded

impl Debug for Upgraded

Auto Trait Implementations

impl !RefUnwindSafe for Upgraded

impl Send for Upgraded

impl !Sync for Upgraded

impl Unpin for Upgraded

impl !UnwindSafe for Upgraded

Blanket Implementations

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

impl<R> AsyncReadExt for R where
    R: AsyncRead + ?Sized

impl<W> AsyncWriteExt for W where
    W: AsyncWrite + ?Sized

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> Instrument for T[src]

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

impl<T> Same<T> for T

type Output = T

Should always be Self

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<V, T> VZip<V> for T where
    V: MultiLane<T>,