pub trait RingBufferWrite<T>: RingBuffer<T> + Extend<T> {
    // Required method
    fn push(&mut self, value: T);

    // Provided method
    fn enqueue(&mut self, value: T) { ... }
}
Expand description

Defines behaviour for ringbuffers which allow for writing to the end of them (as a queue). For arbitrary buffer access however, RingBufferExt is necessary.

Required Methods§

source

fn push(&mut self, value: T)

Pushes a value onto the buffer. Cycles around if capacity is reached.

Provided Methods§

source

fn enqueue(&mut self, value: T)

alias for push, forming a more natural counterpart to dequeue

Implementors§

source§

impl<T> RingBufferWrite<T> for GrowableAllocRingBuffer<T>

source§

impl<T, SIZE: RingbufferSize> RingBufferWrite<T> for AllocRingBuffer<T, SIZE>

source§

impl<T, const CAP: usize> RingBufferWrite<T> for ConstGenericRingBuffer<T, CAP>