Skip to main content

AsyncCons

Type Alias AsyncCons 

Source
pub type AsyncCons<R> = AsyncWrap<R, false, true>;

Aliased Type§

pub struct AsyncCons<R> { /* private fields */ }

Trait Implementations§

Source§

impl<R: AsyncRbRef> AsyncConsumer for AsyncCons<R>

Source§

fn register_waker(&self, waker: &Waker)

Source§

fn close(&mut self)

Source§

fn is_closed(&self) -> bool

Whether the corresponding producer was closed.
Source§

fn pop(&mut self) -> PopFuture<'_, Self>

Pop item from the ring buffer waiting asynchronously if the buffer is empty. Read more
Source§

fn wait_occupied(&mut self, count: usize) -> WaitOccupiedFuture<'_, Self>

Wait for the buffer to contain at least count items or to close. Read more
Source§

fn pop_exact<'a: 'b, 'b>( &'a mut self, slice: &'b mut [Self::Item], ) -> PopSliceFuture<'a, 'b, Self>
where Self::Item: Copy,

Fill slice with items from the ring buffer waiting asynchronously until slice filled or corresponding producer closed. Read more
Source§

fn pop_until_end<'a: 'b, 'b>( &'a mut self, vec: &'b mut Vec<Self::Item>, ) -> PopVecFuture<'a, 'b, Self>

Fill vec with items from the ring buffer waiting asynchronously until corresponding producer closed. Read more
Source§

fn poll_next( self: Pin<&mut Self>, cx: &mut Context<'_>, ) -> Poll<Option<Self::Item>>
where Self: Unpin,

Poll for the next item in the ring buffer.
Source§

fn poll_read( self: Pin<&mut Self>, cx: &mut Context<'_>, buf: &mut [u8], ) -> Poll<Result<usize>>
where Self: AsyncConsumer<Item = u8> + Unpin,

Poll reading bytes from byte buffer.
Source§

impl<R: AsyncRbRef> AsyncRead for AsyncCons<R>
where Self: AsyncConsumer<Item = u8>,

Available on crate feature std only.
Source§

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

Attempt to read from the AsyncRead into buf. Read more
Source§

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

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

impl<R: AsyncRbRef> Stream for AsyncCons<R>

Source§

type Item = <<R as RbRef>::Rb as Observer>::Item

Values yielded by the stream.
Source§

fn poll_next( self: Pin<&mut Self>, cx: &mut Context<'_>, ) -> Poll<Option<Self::Item>>

Attempt to pull out the next value of this stream, registering the current task for wakeup if the value is not yet available, and returning None if the stream is exhausted. Read more
Source§

fn size_hint(&self) -> (usize, Option<usize>)

Returns the bounds on the remaining length of the stream. Read more
Source§

impl<R: AsyncRbRef> DelegateConsumer for AsyncCons<R>