pub struct BlockingMpscProducer { /* private fields */ }Expand description
A single producer handle. Sole writer to one underlying SPSC
ring. !Sync + !Clone + Send: one producer per thread.
Implementations§
Source§impl BlockingMpscProducer
impl BlockingMpscProducer
Sourcepub fn try_push(&self, payload: &[u8]) -> Result<(), RingError>
pub fn try_push(&self, payload: &[u8]) -> Result<(), RingError>
Non-blocking push. On success, increments the shared
total_published counter and fires a wake at the consumer
waker (cheap if no parked consumer).
Sourcepub fn send_blocking(
&self,
payload: &[u8],
timeout: Option<Duration>,
) -> Result<(), BlockingError>
pub fn send_blocking( &self, payload: &[u8], timeout: Option<Duration>, ) -> Result<(), BlockingError>
Block until either push succeeds or timeout elapses.
Producer parks on its OWN ring’s waker; the consumer’s
pop-side wakes the right ring’s waker by try_pop_ring_blocking.
Auto Trait Implementations§
impl !RefUnwindSafe for BlockingMpscProducer
impl !Sync for BlockingMpscProducer
impl !UnwindSafe for BlockingMpscProducer
impl Freeze for BlockingMpscProducer
impl Send for BlockingMpscProducer
impl Unpin for BlockingMpscProducer
impl UnsafeUnpin for BlockingMpscProducer
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