[][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 Drop for Reader[src]

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.

unsafe fn initializer(&self) -> Initializer[src]

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

fn poll_read_vectored(
    self: Pin<&mut Self>,
    cx: &mut Context,
    vec: &mut [IoSliceMut]
) -> Poll<Result<usize, Error>>
[src]

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

Auto Trait Implementations

impl !Send for Reader

impl !Sync for Reader

Blanket Implementations

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.

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

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

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