[][src]Struct futures_util::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]

Creates a new AllowStdIo from an existing IO object.

Important traits for &'_ mut I

Returns a reference to the contained IO object.

Important traits for &'_ mut I

Returns a mutable reference to the contained IO object.

Consumes self and returns the contained IO object.

Trait Implementations

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

Performs copy-assignment from source. Read more

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

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

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

impl<T: Copy> Copy 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: Debug> Debug for AllowStdIo<T>
[src]

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

Feeds a slice of this type into the given [Hasher]. Read more

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

Important traits for &'_ mut I

Creates a "by reference" adaptor for this instance of Write. Read more

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

🔬 This is a nightly-only experimental API. (read_initializer)

Determines if this Reader can work with buffers of uninitialized memory. Read more

Important traits for &'_ mut I

Creates a "by reference" adaptor for this instance of Read. Read more

Important traits for Bytes<R>

Transforms this Read instance to an [Iterator] over its bytes. Read more

Creates an adaptor which will chain this stream with another. Read more

Creates an adaptor which will read at most limit bytes from it. Read more

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

Determines if this AsyncReader can work with buffers of uninitialized memory. Read more

Attempt to read from the AsyncRead into vec using vectored IO operations. Read more

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

Attempt to write bytes from vec into the object using vectored IO operations. Read more

Auto Trait Implementations

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

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

Blanket Implementations

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

Creates a future which copies all the bytes from one object to another. Read more

Tries to read some bytes directly into the given buf in asynchronous manner, returning a future type. Read more

Creates a future which will read exactly enough bytes to fill buf, returning an error if end of file (EOF) is hit sooner. Read more

Creates a future which will read all the bytes from this AsyncRead. Read more

Helper method for splitting this read/write object into two halves. Read more

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

Creates a future which will entirely flush this AsyncWrite. Read more

Creates a future which will entirely close this AsyncWrite.

Write data into this object. Read more

impl<T> From for T
[src]

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

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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