Struct TokioIo

pub struct TokioIo<T> { /* private fields */ }

A wrapper that implements Tokio's IO traits for an inner type that implements hyper's IO traits, or vice versa (implements hyper's IO traits for a type that implements Tokio's IO traits).

Implementations

impl<T> TokioIo<T>

fn new(inner: T) -> Self

Wrap a type implementing Tokio's or hyper's IO traits.

fn inner(&self) -> &T

Borrow the inner type.

fn inner_mut(&mut self) -> &mut T

Mut borrow the inner type.

fn into_inner(self) -> T

Consume this wrapper and get the inner type.

Trait Implementations

impl<'__pin, T> Unpin for TokioIo<T> where PinnedFieldsOf<__Origin<'__pin, T>>: Unpin,

impl<T> AsyncRead for TokioIo<T> where T: Read,

fn poll_read(self: Pin<&mut Self>, cx: &mut Context<'_>, tbuf: &mut ReadBuf<'_>) -> Poll<Result<(), Error>>

impl<T> AsyncWrite for TokioIo<T> where T: Write,

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

impl<T> Connection for TokioIo<T> where T: Connection,

fn connected(&self) -> Connected

impl<T> Read for TokioIo<T> where T: AsyncRead,

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

impl<T> Write for TokioIo<T> where T: AsyncWrite,

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

impl<T: Debug> Debug for TokioIo<T>

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

Auto Trait Implementations

impl<T> Freeze for TokioIo<T> where T: Freeze,

impl<T> RefUnwindSafe for TokioIo<T> where T: RefUnwindSafe,

impl<T> Send for TokioIo<T> where T: Send,

impl<T> Sync for TokioIo<T> where T: Sync,

impl<T> UnsafeUnpin for TokioIo<T> where T: UnsafeUnpin,

impl<T> UnwindSafe for TokioIo<T> where T: UnwindSafe,

Blanket Implementations

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

impl<T> Any for TokioIo<T> where T: 'static + ?Sized,

fn type_id(&self) -> TypeId

impl<T> Borrow<T> for TokioIo<T> where T: ?Sized,

fn borrow(&self) -> &T

impl<T> BorrowMut<T> for TokioIo<T> where T: ?Sized,

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

impl<T> From<T> for TokioIo<T>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> Instrument for TokioIo<T>

impl<T> WithSubscriber for TokioIo<T>

impl<T, U> Into<U> for TokioIo<T> where U: From<T>,

fn into(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<U> for TokioIo<T> where U: Into<T>,

type Error = never;
fn try_from(value: U) -> Result<T, never>

impl<T, U> TryInto<U> for TokioIo<T> where U: TryFrom<T>,

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

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