Struct tokio_util::compat::Compat [−][src]
A compatibility layer that allows conversion between the
tokio::io and futures-io AsyncRead and AsyncWrite traits.
Implementations
impl<T> Compat<T>[src]
pub fn get_ref(&self) -> &T[src]
Get a reference to the Future, Stream, AsyncRead, or AsyncWrite object
contained within.
pub fn get_mut(&mut self) -> &mut T[src]
Get a mutable reference to the Future, Stream, AsyncRead, or AsyncWrite object
contained within.
pub fn into_inner(self) -> T[src]
Returns the wrapped item.
Trait Implementations
impl<T> AsyncBufRead for Compat<T> where
T: AsyncBufRead, [src]
T: AsyncBufRead,
fn poll_fill_buf<'a>(
self: Pin<&'a mut Self>,
cx: &mut Context<'_>
) -> Poll<Result<&'a [u8]>>[src]
self: Pin<&'a mut Self>,
cx: &mut Context<'_>
) -> Poll<Result<&'a [u8]>>
fn consume(self: Pin<&mut Self>, amt: usize)[src]
impl<T> AsyncBufRead for Compat<T> where
T: AsyncBufRead, [src]
T: AsyncBufRead,
fn poll_fill_buf<'a>(
self: Pin<&'a mut Self>,
cx: &mut Context<'_>
) -> Poll<Result<&'a [u8]>>[src]
self: Pin<&'a mut Self>,
cx: &mut Context<'_>
) -> Poll<Result<&'a [u8]>>
fn consume(self: Pin<&mut Self>, amt: usize)[src]
impl<T> AsyncRead for Compat<T> where
T: AsyncRead, [src]
T: AsyncRead,
fn poll_read(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
buf: &mut ReadBuf<'_>
) -> Poll<Result<()>>[src]
self: Pin<&mut Self>,
cx: &mut Context<'_>,
buf: &mut ReadBuf<'_>
) -> Poll<Result<()>>
impl<T> AsyncRead for Compat<T> where
T: AsyncRead, [src]
T: AsyncRead,
fn poll_read(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
slice: &mut [u8]
) -> Poll<Result<usize>>[src]
self: Pin<&mut Self>,
cx: &mut Context<'_>,
slice: &mut [u8]
) -> Poll<Result<usize>>
pub fn poll_read_vectored(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
bufs: &mut [IoSliceMut<'_>]
) -> Poll<Result<usize, Error>>[src]
self: Pin<&mut Self>,
cx: &mut Context<'_>,
bufs: &mut [IoSliceMut<'_>]
) -> Poll<Result<usize, Error>>
impl<T> AsyncWrite for Compat<T> where
T: AsyncWrite, [src]
T: AsyncWrite,
fn poll_write(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
buf: &[u8]
) -> Poll<Result<usize>>[src]
self: Pin<&mut Self>,
cx: &mut Context<'_>,
buf: &[u8]
) -> Poll<Result<usize>>
fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<()>>[src]
fn poll_shutdown(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<()>>[src]
pub fn poll_write_vectored(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
bufs: &[IoSlice<'_>]
) -> Poll<Result<usize, Error>>[src]
self: Pin<&mut Self>,
cx: &mut Context<'_>,
bufs: &[IoSlice<'_>]
) -> Poll<Result<usize, Error>>
pub fn is_write_vectored(&self) -> bool[src]
impl<T> AsyncWrite for Compat<T> where
T: AsyncWrite, [src]
T: AsyncWrite,
fn poll_write(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
buf: &[u8]
) -> Poll<Result<usize>>[src]
self: Pin<&mut Self>,
cx: &mut Context<'_>,
buf: &[u8]
) -> Poll<Result<usize>>
fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<()>>[src]
fn poll_close(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<()>>[src]
pub fn poll_write_vectored(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
bufs: &[IoSlice<'_>]
) -> Poll<Result<usize, Error>>[src]
self: Pin<&mut Self>,
cx: &mut Context<'_>,
bufs: &[IoSlice<'_>]
) -> Poll<Result<usize, Error>>
impl<T: Clone> Clone for Compat<T>[src]
impl<T: Copy> Copy for Compat<T>[src]
impl<T: Debug> Debug for Compat<T>[src]
impl<'__pin, T> Unpin for Compat<T> where
__Origin<'__pin, T>: Unpin, [src]
__Origin<'__pin, T>: Unpin,
Auto Trait Implementations
impl<T> RefUnwindSafe for Compat<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for Compat<T> where
T: Send,
T: Send,
impl<T> Sync for Compat<T> where
T: Sync,
T: Sync,
impl<T> UnwindSafe for Compat<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T> FuturesAsyncReadCompatExt for T where
T: AsyncRead, [src]
T: AsyncRead,
impl<T> FuturesAsyncWriteCompatExt for T where
T: AsyncWrite, [src]
T: AsyncWrite,
fn compat_write(self) -> Compat<Self> where
Self: Sized, [src]
Self: Sized,
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn clone_into(&self, target: &mut T)[src]
impl<T> Tokio02AsyncReadCompatExt for T where
T: AsyncRead, [src]
T: AsyncRead,
impl<T> Tokio02AsyncWriteCompatExt for T where
T: AsyncWrite, [src]
T: AsyncWrite,
fn compat_write(self) -> Compat<Self> where
Self: Sized, [src]
Self: Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,