pub struct BlockingUnboundedSpscProducer<T, const P: usize, const NUM_SEGS_P2: usize> { /* private fields */ }Expand description
Blocking producer for unbounded SPSC queue.
Implementations§
Source§impl<T, const P: usize, const NUM_SEGS_P2: usize> BlockingUnboundedSpscProducer<T, P, NUM_SEGS_P2>
impl<T, const P: usize, const NUM_SEGS_P2: usize> BlockingUnboundedSpscProducer<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 blocking.
For unbounded queues, this always succeeds unless the channel is closed.
Sourcepub fn send(&self, value: T) -> Result<(), PushError<T>>
pub fn send(&self, value: T) -> Result<(), PushError<T>>
Sends a single item.
For unbounded queues, this never blocks since the queue grows dynamically.
Sourcepub fn send_slice(&self, values: &mut Vec<T>) -> Result<(), PushError<()>>
pub fn send_slice(&self, values: &mut Vec<T>) -> Result<(), PushError<()>>
Sends a Vec of items 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 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.
Auto Trait Implementations§
impl<T, const P: usize, const NUM_SEGS_P2: usize> Freeze for BlockingUnboundedSpscProducer<T, P, NUM_SEGS_P2>
impl<T, const P: usize, const NUM_SEGS_P2: usize> !RefUnwindSafe for BlockingUnboundedSpscProducer<T, P, NUM_SEGS_P2>
impl<T, const P: usize, const NUM_SEGS_P2: usize> Send for BlockingUnboundedSpscProducer<T, P, NUM_SEGS_P2>
impl<T, const P: usize, const NUM_SEGS_P2: usize> Sync for BlockingUnboundedSpscProducer<T, P, NUM_SEGS_P2>
impl<T, const P: usize, const NUM_SEGS_P2: usize> Unpin for BlockingUnboundedSpscProducer<T, P, NUM_SEGS_P2>
impl<T, const P: usize, const NUM_SEGS_P2: usize> !UnwindSafe for BlockingUnboundedSpscProducer<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
Mutably borrows from an owned value. Read more