[][src]Struct tokio_io::io::AllowStdIo

pub struct AllowStdIo<T>(_);

A simple wrapper type which allows types that only implement std::io::Read or std::io::Write to be used in contexts which expect an AsyncRead or AsyncWrite.

If these types issue an error with the kind io::ErrorKind::WouldBlock, it is expected that they will notify the current task on readiness. Synchronous std types should not issue errors of this kind and are safe to use in this context. However, using these types with AllowStdIo will cause the event loop to block, so they should be used with care.

Methods

impl<T> AllowStdIo<T>[src]

pub fn new(io: T) -> Self[src]

Creates a new AllowStdIo from an existing IO object.

pub fn get_ref(&self) -> &T[src]

Returns a reference to the contained IO object.

pub fn get_mut(&mut self) -> &mut T[src]

Returns a mutable reference to the contained IO object.

pub fn into_inner(self) -> T[src]

Consumes self and returns the contained IO object.

Trait Implementations

impl<T> AsyncRead for AllowStdIo<T> where
    T: Read
[src]

impl<T> AsyncWrite for AllowStdIo<T> where
    T: Write
[src]

impl<T: Eq> Eq for AllowStdIo<T>[src]

impl<T: Clone> Clone for AllowStdIo<T>[src]

impl<T: PartialOrd> PartialOrd<AllowStdIo<T>> for AllowStdIo<T>[src]

impl<T: PartialEq> PartialEq<AllowStdIo<T>> for AllowStdIo<T>[src]

impl<T: Ord> Ord for AllowStdIo<T>[src]

impl<T: Copy> Copy for AllowStdIo<T>[src]

impl<T: Hash> Hash for AllowStdIo<T>[src]

impl<T: Debug> Debug for AllowStdIo<T>[src]

impl<T> Read for AllowStdIo<T> where
    T: Read
[src]

impl<T> Write for AllowStdIo<T> where
    T: Write
[src]

Auto Trait Implementations

impl<T> Send for AllowStdIo<T> where
    T: Send

impl<T> Unpin for AllowStdIo<T> where
    T: Unpin

impl<T> Sync for AllowStdIo<T> where
    T: Sync

impl<T> UnwindSafe for AllowStdIo<T> where
    T: UnwindSafe

impl<T> RefUnwindSafe for AllowStdIo<T> where
    T: RefUnwindSafe

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<R> ReadBytesExt for R where
    R: Read + ?Sized
[src]

impl<W> WriteBytesExt for W where
    W: Write + ?Sized
[src]