[][src]Struct futures::io::AllowStdIo

pub struct AllowStdIo<T>(_);

A simple wrapper type which allows types which implement 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]

Important traits for AllowStdIo<T>
pub fn new(io: T) -> AllowStdIo<T>[src]

Creates a new AllowStdIo from an existing IO object.

Important traits for &'_ mut F
pub fn get_ref(&self) -> &T[src]

Returns a reference to the contained IO object.

Important traits for &'_ mut F
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> AsyncBufRead for AllowStdIo<T> where
    T: BufRead
[src]

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

impl<T> AsyncSeek for AllowStdIo<T> where
    T: Seek
[src]

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

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

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

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

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

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

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

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

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

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

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

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

impl<T> StructuralEq for AllowStdIo<T>[src]

impl<T> StructuralPartialEq for AllowStdIo<T>[src]

impl<T> Unpin for AllowStdIo<T>[src]

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

Auto Trait Implementations

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

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

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

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

Blanket Implementations

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

impl<R> AsyncBufReadExt for R where
    R: AsyncBufRead + ?Sized
[src]

impl<R> AsyncReadExt for R where
    R: AsyncRead + ?Sized
[src]

impl<S> AsyncSeekExt for S where
    S: AsyncSeek + ?Sized
[src]

impl<W> AsyncWriteExt for W where
    W: AsyncWrite + ?Sized
[src]

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

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

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

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

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

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

type Owned = T

The resulting type after obtaining ownership.

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<W> WriteBytesExt for W where
    W: Write + ?Sized