Type Alias AsyncProd

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

Aliased Type§

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

Implementations

Source§

impl<R: AsyncRbRef, const P: bool, const C: bool> AsyncWrap<R, P, C>

Source

pub unsafe fn new(rb: R) -> Self

Source

pub fn observe(&self) -> Obs<R>

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>

Source§

impl<R: AsyncRbRef, const P: bool, const C: bool> AsMut<AsyncWrap<R, P, C>> for AsyncWrap<R, P, C>

Source§

fn as_mut(&mut self) -> &mut Self

Converts this type into a mutable reference of the (usually inferred) input type.
Source§

impl<R: AsyncRbRef, const P: bool, const C: bool> AsRef<AsyncWrap<R, P, C>> for AsyncWrap<R, P, C>

Source§

fn as_ref(&self) -> &Self

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<R: AsyncRbRef, const P: bool, const C: bool> Based for AsyncWrap<R, P, C>

Source§

type Base = Direct<R, P, C>

Type the wrapper based on.
Source§

fn base(&self) -> &Self::Base

Reference to base.
Source§

fn base_mut(&mut self) -> &mut Self::Base

Mutable reference to base.
Source§

impl<R: AsyncRbRef, const P: bool, const C: bool> Wrap for AsyncWrap<R, P, C>

Source§

type RbRef = R

Ring buffer reference type.
Source§

fn rb_ref(&self) -> &R

Underlying ring buffer reference.
Source§

fn into_rb_ref(self) -> R

Destructure into underlying ring buffer reference.
§

fn rb(&self) -> &<Self::RbRef as RbRef>::Rb

Underlying ring buffer.
Source§

impl<R: AsyncRbRef, const P: bool, const C: bool> DelegateObserver for AsyncWrap<R, P, C>

Source§

impl<R: AsyncRbRef, const P: bool, const C: bool> Unpin for AsyncWrap<R, P, C>