Struct hyper_util::rt::tokio::TokioIo

source ·
pub struct TokioIo<T> { /* private fields */ }
Expand description

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§

source§

impl<T> TokioIo<T>

source

pub fn new(inner: T) -> Self

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

source

pub fn inner(&self) -> &T

Borrow the inner type.

source

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

Mut borrow the inner type.

source

pub fn into_inner(self) -> T

Consume this wrapper and get the inner type.

Trait Implementations§

source§

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

source§

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

Attempts to read from the AsyncRead into buf. Read more
source§

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

source§

fn poll_write( self: Pin<&mut Self>, cx: &mut Context<'_>, buf: &[u8], ) -> Poll<Result<usize, Error>>

Attempt to write bytes from buf into the object. Read more
source§

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

Attempts to flush the object, ensuring that any buffered data reach their destination. Read more
source§

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

Initiates or attempts to shut down this writer, returning success when the I/O connection has completely shut down. Read more
source§

fn is_write_vectored(&self) -> bool

Determines if this writer has an efficient poll_write_vectored implementation. Read more
source§

fn poll_write_vectored( self: Pin<&mut Self>, cx: &mut Context<'_>, bufs: &[IoSlice<'_>], ) -> Poll<Result<usize, Error>>

Like poll_write, except that it writes from a slice of buffers. Read more
source§

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

source§

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

Formats the value using the given formatter. Read more
source§

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

source§

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

Attempts to read bytes into the buf. Read more
source§

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

source§

fn poll_write( self: Pin<&mut Self>, cx: &mut Context<'_>, buf: &[u8], ) -> Poll<Result<usize, Error>>

Attempt to write bytes from buf into the destination. Read more
source§

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

Attempts to flush the object. Read more
source§

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

Attempts to shut down this writer.
source§

fn is_write_vectored(&self) -> bool

Returns whether this writer has an efficient poll_write_vectored implementation. Read more
source§

fn poll_write_vectored( self: Pin<&mut Self>, cx: &mut Context<'_>, bufs: &[IoSlice<'_>], ) -> Poll<Result<usize, Error>>

Like poll_write, except that it writes from a slice of buffers.
source§

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

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> UnwindSafe for TokioIo<T>
where T: UnwindSafe,

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

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

Performs the conversion.
source§

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

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

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

Performs the conversion.
source§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,