[][src]Struct async_ringbuffer::Reader

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 data becomes available.

Methods

impl Reader[src]

pub fn is_closed(&self) -> bool[src]

Returns true if the writer side of the ringbuffer has been closed. Reads will continue to produce data as long as there are still unread bytes in the ringbuffer.

Trait Implementations

impl AsyncRead for Reader[src]

fn poll_read(
    self: Pin<&mut Self>,
    cx: &mut Context,
    buf: &mut [u8]
) -> Poll<Result<usize>>
[src]

Read data from the RingBuffer.

This only returns Ok(Ready(0)) if either buf.len() == 0, poll_close was called on the corresponding Writer and all buffered data has been read, or if the corresponding Writer has been dropped.

Errors

This never emits an error.

impl Drop for Reader[src]

Auto Trait Implementations

impl !RefUnwindSafe for Reader

impl !Send for Reader

impl !Sync for Reader

impl Unpin for Reader

impl !UnwindSafe for Reader

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?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<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.