pub struct TokioCompat<T> { /* private fields */ }Expand description
Exposes a Moirai reader, writer, or buffered reader through the
tokio::io traits.
The wrapper forwards every poll, including the task context, so the waker a
Tokio caller registers is the waker the Moirai type stores. It keeps the
layout of T and allocates nothing.
Implementations§
Source§impl<T> TokioCompat<T>
impl<T> TokioCompat<T>
Sourcepub fn new(inner: T) -> TokioCompat<T>
pub fn new(inner: T) -> TokioCompat<T>
Create a new Tokio compatibility wrapper.
Sourcepub fn into_inner(self) -> T
pub fn into_inner(self) -> T
Extract the inner type.
Trait Implementations§
Source§impl<T> From<T> for TokioCompat<T>
impl<T> From<T> for TokioCompat<T>
Source§fn from(inner: T) -> TokioCompat<T>
fn from(inner: T) -> TokioCompat<T>
Converts to this type from the input type.
Auto Trait Implementations§
impl<T> Freeze for TokioCompat<T>where
T: Freeze,
impl<T> RefUnwindSafe for TokioCompat<T>where
T: RefUnwindSafe,
impl<T> Send for TokioCompat<T>where
T: Send,
impl<T> Sync for TokioCompat<T>where
T: Sync,
impl<T> Unpin for TokioCompat<T>where
T: Unpin,
impl<T> UnsafeUnpin for TokioCompat<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for TokioCompat<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more