Struct Upgraded

struct Upgraded { ... }

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

fn downcast<T: Read + Write + Unpin + 'static>(self: Self) -> Result<Parts<T>, Self>

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

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

impl Debug for Upgraded

fn fmt(self: &Self, f: &mut fmt::Formatter<'_>) -> fmt::Result

impl Freeze for Upgraded

impl Read for Upgraded

fn poll_read(self: Pin<&mut Self>, cx: &mut Context<'_>, buf: ReadBufCursor<'_>) -> Poll<io::Result<()>>

impl RefUnwindSafe for Upgraded

impl Send for Upgraded

impl Sync for Upgraded

impl Unpin for Upgraded

impl UnwindSafe for Upgraded

impl Write for Upgraded

fn poll_write(self: Pin<&mut Self>, cx: &mut Context<'_>, buf: &[u8]) -> Poll<io::Result<usize>>
fn poll_write_vectored(self: Pin<&mut Self>, cx: &mut Context<'_>, bufs: &[io::IoSlice<'_>]) -> Poll<io::Result<usize>>
fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<io::Result<()>>
fn poll_shutdown(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<io::Result<()>>
fn is_write_vectored(self: &Self) -> bool

impl<T> Any for Upgraded

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for Upgraded

fn borrow(self: &Self) -> &T

impl<T> BorrowMut for Upgraded

fn borrow_mut(self: &mut Self) -> &mut T

impl<T> From for Upgraded

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> Instrument for Upgraded

impl<T> WithSubscriber for Upgraded

impl<T, U> Into for Upgraded

fn into(self: Self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom for Upgraded

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

impl<T, U> TryInto for Upgraded

fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>