Struct async_ringbuffer::Reader [] [src]

pub struct Reader(_);

Read access to a nonblocking ring buffer with fixed capacity.

If there is no data in the buffer to read from, the current task is parked and notified once space becomes available.

Trait Implementations

impl Drop for Reader
[src]

[src]

Executes the destructor for this type. Read more

impl Read for Reader
[src]

Nonblocking Read implementation.

[src]

Read data from the RingBuffer. The only error this may return is of kind WouldBlock. When this returns a WouldBlock error, the current task is parked and gets notified once more data becomes available the buffer.

This returns only returns Ok(0) if either buf.len() == 0, shutdown was called on the writer and all buffered data has been read, or if the corresponding Writer has been dropped and no new data will become available. If the Reader task is parked while the Writer is dropped, the task gets notified.

If a previous call to write returned a WouldBlock error, the corresponding Writer is unparked if data was written in this read call.

[src]

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

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

1.0.0
[src]

Read all bytes until EOF in this source, placing them into buf. Read more

1.0.0
[src]

Read all bytes until EOF in this source, placing them into buf. Read more

1.6.0
[src]

Read the exact number of bytes required to fill buf. Read more

1.0.0
[src]

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

1.0.0
[src]

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

[src]

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

the semantics of a partial read/write of where errors happen is currently unclear and may change

Transforms this Read instance to an [Iterator] over [char]s. Read more

1.0.0
[src]

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

1.0.0
[src]

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

impl AsyncRead for Reader
[src]

[src]

Prepares an uninitialized buffer to be safe to pass to read. Returns true if the supplied buffer was zeroed out. Read more

[src]

Pull some bytes from this source into the specified Buf, returning how many bytes were read. Read more

[src]

Provides a Stream and Sink interface for reading and writing to this Io object, using Decode and Encode to read and write the raw data. Read more

[src]

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