pub struct Reader(/* private fields */);
Expand description
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.
Implementations§
Trait Implementations§
Source§impl AsyncRead for Reader
impl AsyncRead for Reader
Source§fn poll_read(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
buf: &mut [u8],
) -> Poll<Result<usize>>
fn poll_read( self: Pin<&mut Self>, cx: &mut Context<'_>, buf: &mut [u8], ) -> Poll<Result<usize>>
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.
Auto Trait Implementations§
impl Freeze for Reader
impl !RefUnwindSafe for Reader
impl !Send for Reader
impl !Sync for Reader
impl Unpin for Reader
impl !UnwindSafe for Reader
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more