Type Definition ringbuf::producer::PostponedProducer

source ·
pub type PostponedProducer<T, R> = Producer<T, RbWrap<RbWriteCache<T, R>>>;
Expand description

Postponed producer.

Implementations§

source§

impl<T, R: RbRef> PostponedProducer<T, R>where R::Rb: RbWrite<T>,

source

pub unsafe fn new_postponed(target: R) -> Self

Create new postponed producer.

Safety

There must be only one producer containing the same ring buffer reference.

source

pub fn sync(&mut self)

Synchronize changes with the ring buffer.

Postponed producer requires manual synchronization to make pushed items visible for the consumer.

source

pub fn discard(&mut self)

Don’t publish and drop items inserted since last synchronization.

source

pub fn into_immediate(self) -> Producer<T, R>

Synchronize and transform back to immediate producer.