Type Definition ringbuf::consumer::PostponedConsumer

source ·
pub type PostponedConsumer<T, R> = Consumer<T, RbWrap<RbReadCache<T, R>>>;
Expand description

Postponed consumer.

Implementations§

source§

impl<T, R: RbRef> PostponedConsumer<T, R>where R::Rb: RbRead<T>,

source

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

Create new postponed consumer.

Safety

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

source

pub fn sync(&mut self)

Synchronize changes with the ring buffer.

Postponed consumer requires manual synchronization to make freed space visible for the producer.

source

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

Synchronize and transform back to immediate consumer.