Struct WithHyperIo

pub struct WithHyperIo<I> { /* private fields */ }

Extends an underlying tokio I/O with hyper I/O implementations.

This implements Read and Write given an inner type that implements AsyncRead and AsyncWrite, respectively.

Implementations

impl<I> WithHyperIo<I>

fn new(inner: I) -> Self

Wraps the inner I/O in an [WithHyperIo<I>]

fn inner(&self) -> &I

Returns a reference to the inner type.

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

Returns a mutable reference to the inner type.

fn into_inner(self) -> I

Consumes this wrapper and returns the inner type.

Trait Implementations

impl<'__pin, I> Unpin for WithHyperIo<I> where PinnedFieldsOf<__Origin<'__pin, I>>: Unpin,

impl<I> AsyncRead for WithHyperIo<I> where I: AsyncRead,

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

impl<I> AsyncWrite for WithHyperIo<I> where I: 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<I> Read for WithHyperIo<I> where I: AsyncRead,

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

impl<I> Write for WithHyperIo<I> where I: 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<I: Debug> Debug for WithHyperIo<I>

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

Auto Trait Implementations

impl<I> Freeze for WithHyperIo<I> where I: Freeze,

impl<I> RefUnwindSafe for WithHyperIo<I> where I: RefUnwindSafe,

impl<I> Send for WithHyperIo<I> where I: Send,

impl<I> Sync for WithHyperIo<I> where I: Sync,

impl<I> UnsafeUnpin for WithHyperIo<I> where I: UnsafeUnpin,

impl<I> UnwindSafe for WithHyperIo<I> where I: UnwindSafe,

Blanket Implementations

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

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

fn type_id(&self) -> TypeId

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

fn borrow(&self) -> &T

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

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

impl<T> From<T> for WithHyperIo<I>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> Instrument for WithHyperIo<I>

impl<T> WithSubscriber for WithHyperIo<I>

impl<T, U> Into<U> for WithHyperIo<I> 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 WithHyperIo<I> where U: Into<T>,

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

impl<T, U> TryInto<U> for WithHyperIo<I> 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 WithHyperIo<I> where W: AsyncWrite + ?Sized,