Ring

Associated Functions for the Ring type

Built-in associated functions for the Ring<T, N> type.

A circular buffer with fixed capacity that overwrites old elements when full.


Ring Operations

enqueue

fn enqueue(mut self, element: T)

Adds an element to the ring. If the ring is full, overwrites the oldest element.

dequeue

fn dequeue(mut self) -> T

Removes and returns the oldest element from the ring.

clear

fn clear(mut self)

Removes all elements from the ring. Sets the lenght to zero and zeroes the cursor.


For additional associated functions like len, is_empty, filter, find, etc., see Sequential functions.