pub struct AsyncUnboundedSpscProducer<T, const P: usize, const NUM_SEGS_P2: usize> { /* private fields */ }Expand description
Asynchronous producer for unbounded SPSC queue.
This type provides async send operations for an unbounded queue that automatically expands by creating new segments as needed. Never blocks on full queue since the queue grows dynamically.
Implementations§
Source§impl<T, const P: usize, const NUM_SEGS_P2: usize> AsyncUnboundedSpscProducer<T, P, NUM_SEGS_P2>
impl<T, const P: usize, const NUM_SEGS_P2: usize> AsyncUnboundedSpscProducer<T, P, NUM_SEGS_P2>
Sourcepub fn try_send(&self, value: T) -> Result<(), PushError<T>>
pub fn try_send(&self, value: T) -> Result<(), PushError<T>>
Fast-path send without suspension.
For unbounded queues, this always succeeds unless the channel is closed.
Sourcepub async fn send(&mut self, value: T) -> Result<(), PushError<T>>
pub async fn send(&mut self, value: T) -> Result<(), PushError<T>>
Asynchronously sends a single item.
For unbounded queues, this typically completes immediately unless the channel is closed. The async interface is provided for API consistency.
Sourcepub async fn send_batch(
&mut self,
values: &mut Vec<T>,
) -> Result<(), PushError<()>>
pub async fn send_batch( &mut self, values: &mut Vec<T>, ) -> Result<(), PushError<()>>
Sends an entire Vec, moving items out using bulk operations.
On return, the Vec will be empty if all items were sent, or contain only the items that were not sent (if the channel closed).
Sourcepub async fn send_iter<I>(&mut self, iter: I) -> Result<(), PushError<T>>where
I: IntoIterator<Item = T>,
pub async fn send_iter<I>(&mut self, iter: I) -> Result<(), PushError<T>>where
I: IntoIterator<Item = T>,
Sends every item from the iterator.
Sourcepub fn node_count(&self) -> usize
pub fn node_count(&self) -> usize
Returns the number of nodes in the unbounded queue.
Sourcepub fn total_capacity(&self) -> usize
pub fn total_capacity(&self) -> usize
Returns the total capacity across all nodes.
Trait Implementations§
Source§impl<T, const P: usize, const NUM_SEGS_P2: usize> Sink<T> for AsyncUnboundedSpscProducer<T, P, NUM_SEGS_P2>
impl<T, const P: usize, const NUM_SEGS_P2: usize> Sink<T> for AsyncUnboundedSpscProducer<T, P, NUM_SEGS_P2>
Source§fn poll_ready(
self: Pin<&mut Self>,
_cx: &mut Context<'_>,
) -> Poll<Result<(), PushError<T>>>
fn poll_ready( self: Pin<&mut Self>, _cx: &mut Context<'_>, ) -> Poll<Result<(), PushError<T>>>
Sink to receive a value. Read moreSource§fn start_send(self: Pin<&mut Self>, item: T) -> Result<(), PushError<T>>
fn start_send(self: Pin<&mut Self>, item: T) -> Result<(), PushError<T>>
poll_ready which returned Poll::Ready(Ok(())). Read moreAuto Trait Implementations§
impl<T, const P: usize, const NUM_SEGS_P2: usize> Freeze for AsyncUnboundedSpscProducer<T, P, NUM_SEGS_P2>
impl<T, const P: usize, const NUM_SEGS_P2: usize> !RefUnwindSafe for AsyncUnboundedSpscProducer<T, P, NUM_SEGS_P2>
impl<T, const P: usize, const NUM_SEGS_P2: usize> Send for AsyncUnboundedSpscProducer<T, P, NUM_SEGS_P2>
impl<T, const P: usize, const NUM_SEGS_P2: usize> Sync for AsyncUnboundedSpscProducer<T, P, NUM_SEGS_P2>
impl<T, const P: usize, const NUM_SEGS_P2: usize> Unpin for AsyncUnboundedSpscProducer<T, P, NUM_SEGS_P2>
impl<T, const P: usize, const NUM_SEGS_P2: usize> !UnwindSafe for AsyncUnboundedSpscProducer<T, P, NUM_SEGS_P2>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T, Item> SinkExt<Item> for T
impl<T, Item> SinkExt<Item> for T
Source§fn with<U, Fut, F, E>(self, f: F) -> With<Self, Item, U, Fut, F>
fn with<U, Fut, F, E>(self, f: F) -> With<Self, Item, U, Fut, F>
Source§fn with_flat_map<U, St, F>(self, f: F) -> WithFlatMap<Self, Item, U, St, F>
fn with_flat_map<U, St, F>(self, f: F) -> WithFlatMap<Self, Item, U, St, F>
Source§fn sink_map_err<E, F>(self, f: F) -> SinkMapErr<Self, F>
fn sink_map_err<E, F>(self, f: F) -> SinkMapErr<Self, F>
Source§fn sink_err_into<E>(self) -> SinkErrInto<Self, Item, E>
fn sink_err_into<E>(self) -> SinkErrInto<Self, Item, E>
Into trait. Read moreSource§fn buffer(self, capacity: usize) -> Buffer<Self, Item>where
Self: Sized,
fn buffer(self, capacity: usize) -> Buffer<Self, Item>where
Self: Sized,
Source§fn flush(&mut self) -> Flush<'_, Self, Item> ⓘwhere
Self: Unpin,
fn flush(&mut self) -> Flush<'_, Self, Item> ⓘwhere
Self: Unpin,
Source§fn send(&mut self, item: Item) -> Send<'_, Self, Item> ⓘwhere
Self: Unpin,
fn send(&mut self, item: Item) -> Send<'_, Self, Item> ⓘwhere
Self: Unpin,
Source§fn feed(&mut self, item: Item) -> Feed<'_, Self, Item> ⓘwhere
Self: Unpin,
fn feed(&mut self, item: Item) -> Feed<'_, Self, Item> ⓘwhere
Self: Unpin,
Source§fn send_all<'a, St>(&'a mut self, stream: &'a mut St) -> SendAll<'a, Self, St> ⓘ
fn send_all<'a, St>(&'a mut self, stream: &'a mut St) -> SendAll<'a, Self, St> ⓘ
Source§fn right_sink<Si1>(self) -> Either<Si1, Self> ⓘ
fn right_sink<Si1>(self) -> Either<Si1, Self> ⓘ
Source§fn poll_ready_unpin(
&mut self,
cx: &mut Context<'_>,
) -> Poll<Result<(), Self::Error>>where
Self: Unpin,
fn poll_ready_unpin(
&mut self,
cx: &mut Context<'_>,
) -> Poll<Result<(), Self::Error>>where
Self: Unpin,
Sink::poll_ready on Unpin
sink types.Source§fn start_send_unpin(&mut self, item: Item) -> Result<(), Self::Error>where
Self: Unpin,
fn start_send_unpin(&mut self, item: Item) -> Result<(), Self::Error>where
Self: Unpin,
Sink::start_send on Unpin
sink types.