async_ringbuf::wrap

Type Alias AsyncProd

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

Aliased Type§

struct AsyncProd<R> { /* private fields */ }

Trait Implementations§

Source§

impl<R: AsyncRbRef> AsyncProducer for AsyncProd<R>

Source§

fn register_waker(&self, waker: &Waker)

Source§

fn close(&mut self)

Source§

fn is_closed(&self) -> bool

Whether the corresponding consumer was closed.
Source§

fn push(&mut self, item: Self::Item) -> PushFuture<'_, Self>

Push item to the ring buffer waiting asynchronously if the buffer is full. Read more
Source§

fn push_iter_all<I: Iterator<Item = Self::Item>>( &mut self, iter: I, ) -> PushIterFuture<'_, Self, I>

Push items from iterator waiting asynchronously if the buffer is full. Read more
Source§

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

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

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

Copy slice contents to the buffer waiting asynchronously if the buffer is full. Read more
Source§

fn poll_ready(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<bool>

Source§

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

Source§

impl<R: AsyncRbRef> AsyncWrite for AsyncProd<R>
where R::Rb: RingBuffer<Item = u8>,

Source§

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

Attempt to write bytes from buf into the object. Read more
Source§

fn poll_flush(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<Result<()>>

Attempt to flush the object, ensuring that any buffered data reach their destination. Read more
Source§

fn poll_close(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<Result<()>>

Attempt to close the object. Read more
§

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

Attempt to write bytes from bufs into the object using vectored IO operations. Read more
Source§

impl<R: AsyncRbRef> Sink<<<R as RbRef>::Rb as Observer>::Item> for AsyncProd<R>

Source§

type Error = ()

The type of value produced by the sink when an error occurs.
Source§

fn poll_ready( self: Pin<&mut Self>, cx: &mut Context<'_>, ) -> Poll<Result<(), Self::Error>>

Attempts to prepare the Sink to receive a value. Read more
Source§

fn start_send( self: Pin<&mut Self>, item: <R::Rb as Observer>::Item, ) -> Result<(), Self::Error>

Begin the process of sending a value to the sink. Each call to this function must be preceded by a successful call to poll_ready which returned Poll::Ready(Ok(())). Read more
Source§

fn poll_flush( self: Pin<&mut Self>, _cx: &mut Context<'_>, ) -> Poll<Result<(), Self::Error>>

Flush any remaining output from this sink. Read more
Source§

fn poll_close( self: Pin<&mut Self>, _cx: &mut Context<'_>, ) -> Poll<Result<(), Self::Error>>

Flush any remaining output and close this sink, if necessary. Read more
Source§

impl<R: AsyncRbRef> DelegateProducer for AsyncProd<R>