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>
impl<R: AsyncRbRef> AsyncProducer for AsyncProd<R>
fn register_waker(&self, waker: &Waker)
fn close(&mut self)
Source§fn push(&mut self, item: Self::Item) -> PushFuture<'_, Self> ⓘ
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> ⓘ
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> ⓘ
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 moreSource§fn push_exact<'a: 'b, 'b>(
&'a mut self,
slice: &'b [Self::Item],
) -> PushSliceFuture<'a, 'b, Self> ⓘ
fn push_exact<'a: 'b, 'b>( &'a mut self, slice: &'b [Self::Item], ) -> PushSliceFuture<'a, 'b, Self> ⓘ
Copy slice contents to the buffer waiting asynchronously if the buffer is full. Read more
fn poll_ready(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<bool>
fn poll_write( self: Pin<&mut Self>, cx: &mut Context<'_>, buf: &[u8], ) -> Poll<Result<usize>>
Source§impl<R: AsyncRbRef> AsyncWrite for AsyncProd<R>where
R::Rb: RingBuffer<Item = u8>,
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>>
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 moreSource§fn poll_flush(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<Result<()>>
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§impl<R: AsyncRbRef> Sink<<<R as RbRef>::Rb as Observer>::Item> for AsyncProd<R>
impl<R: AsyncRbRef> Sink<<<R as RbRef>::Rb as Observer>::Item> for AsyncProd<R>
Source§fn poll_ready(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
) -> Poll<Result<(), Self::Error>>
fn poll_ready( self: Pin<&mut Self>, cx: &mut Context<'_>, ) -> Poll<Result<(), Self::Error>>
Attempts to prepare the
Sink
to receive a value. Read moreSource§fn start_send(
self: Pin<&mut Self>,
item: <R::Rb as Observer>::Item,
) -> Result<(), Self::Error>
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