[][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][]

Creates a new AllowStdIo from an existing IO object.

Returns a reference to the contained IO object.

Returns a mutable reference to the contained IO object.

Consumes self and returns the contained IO object.

Trait Implementations

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

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

Performs copy-assignment from source. Read more

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

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

Returns the length of this stream (in bytes). Read more

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

Returns the current seek position from the start of the stream. Read more

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

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

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

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

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

Like write, except that it writes from a slice of buffers. Read more

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

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

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

Read all bytes into buf until the delimiter byte or EOF is reached. Read more

Read all bytes until a newline (the 0xA byte) is reached, and append them to the provided buffer. Read more

Returns an iterator over the contents of this reader split on the byte byte. Read more

Returns an iterator over the lines of this reader. Read more

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

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

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

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

Restrict a value to a certain interval. Read more

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

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

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

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> Read for AllowStdIo<T> where
    T: Read
[src][+]

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

Like read, except that it reads into a slice of buffers. Read more

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

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

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

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> AsyncWrite for AllowStdIo<T> where
    T: Write
[src][+]

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

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

Auto Trait Implementations

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

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

Blanket Implementations

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][+]

type Owned = T

The resulting type after obtaining ownership.

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

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

impl<T, U> TryInto 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<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

Wraps an [AsyncRead] in a compatibility wrapper that allows it to be used as a futures 0.1 / tokio-io 0.1 AsyncRead. If the wrapped type implements [AsyncWrite] as well, the result will also implement the futures 0.1 / tokio 0.1 AsyncWrite trait. 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

Wraps an [AsyncWrite] in a compatibility wrapper that allows it to be used as a futures 0.1 / tokio-io 0.1 AsyncWrite. Requires the io-compat feature to enable. Read more

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

Creates a future which will seek an IO object, and then yield the new position in the object and the object itself. Read more

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

Creates a future which will read all the bytes associated with this I/O object into buf until the delimiter byte or EOF is reached. This method is the async equivalent to BufRead::read_until. Read more

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

Reads an unsigned 8 bit integer from the underlying reader. Read more

Reads a signed 8 bit integer from the underlying reader. Read more

Reads an unsigned 16 bit integer from the underlying reader. Read more

Reads a signed 16 bit integer from the underlying reader. Read more

Reads an unsigned 24 bit integer from the underlying reader. Read more

Reads a signed 24 bit integer from the underlying reader. Read more

Reads an unsigned 32 bit integer from the underlying reader. Read more

Reads a signed 32 bit integer from the underlying reader. Read more

Reads an unsigned 48 bit integer from the underlying reader. Read more

Reads a signed 48 bit integer from the underlying reader. Read more

Reads an unsigned 64 bit integer from the underlying reader. Read more

Reads a signed 64 bit integer from the underlying reader. Read more

Reads an unsigned 128 bit integer from the underlying reader. Read more

Reads a signed 128 bit integer from the underlying reader. Read more

Reads an unsigned n-bytes integer from the underlying reader. Read more

Reads a signed n-bytes integer from the underlying reader. Read more

Reads an unsigned n-bytes integer from the underlying reader.

Reads a signed n-bytes integer from the underlying reader.

Reads a IEEE754 single-precision (4 bytes) floating point number from the underlying reader. Read more

Reads a IEEE754 double-precision (8 bytes) floating point number from the underlying reader. Read more

Reads a sequence of unsigned 16 bit integers from the underlying reader. Read more

Reads a sequence of unsigned 32 bit integers from the underlying reader. Read more

Reads a sequence of unsigned 64 bit integers from the underlying reader. Read more

Reads a sequence of unsigned 128 bit integers from the underlying reader. Read more

Reads a sequence of signed 16 bit integers from the underlying reader. Read more

Reads a sequence of signed 32 bit integers from the underlying reader. Read more

Reads a sequence of signed 64 bit integers from the underlying reader. Read more

Reads a sequence of signed 128 bit integers from the underlying reader. Read more

Reads a sequence of IEEE754 single-precision (4 bytes) floating point numbers from the underlying reader. Read more

Deprecated since 1.2.0:

please use read_f32_into instead

DEPRECATED. Read more

Reads a sequence of IEEE754 double-precision (8 bytes) floating point numbers from the underlying reader. Read more

Deprecated since 1.2.0:

please use read_f64_into instead

DEPRECATED. Read more

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

Writes an unsigned 8 bit integer to the underlying writer. Read more

Writes a signed 8 bit integer to the underlying writer. Read more

Writes an unsigned 16 bit integer to the underlying writer. Read more

Writes a signed 16 bit integer to the underlying writer. Read more

Writes an unsigned 24 bit integer to the underlying writer. Read more

Writes a signed 24 bit integer to the underlying writer. Read more

Writes an unsigned 32 bit integer to the underlying writer. Read more

Writes a signed 32 bit integer to the underlying writer. Read more

Writes an unsigned 48 bit integer to the underlying writer. Read more

Writes a signed 48 bit integer to the underlying writer. Read more

Writes an unsigned 64 bit integer to the underlying writer. Read more

Writes a signed 64 bit integer to the underlying writer. Read more

Writes an unsigned 128 bit integer to the underlying writer.

Writes a signed 128 bit integer to the underlying writer.

Writes an unsigned n-bytes integer to the underlying writer. Read more

Writes a signed n-bytes integer to the underlying writer. Read more

Writes an unsigned n-bytes integer to the underlying writer. Read more

Writes a signed n-bytes integer to the underlying writer. Read more

Writes a IEEE754 single-precision (4 bytes) floating point number to the underlying writer. Read more

Writes a IEEE754 double-precision (8 bytes) floating point number to the underlying writer. Read more