async_ringbuf::wrap

Type Alias AsyncCons

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

Aliased Type§

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,

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

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

Source§

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

Source§

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

Source§

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

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
§

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
§

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>