Struct amethyst_utils::circular_buffer::CircularBuffer [−][src]
pub struct CircularBuffer<A> { /* fields omitted */ }A CircularBuffer that drops the oldest element inserted when full.
Methods
impl<A> CircularBuffer<A>[src]
impl<A> CircularBuffer<A>pub fn new<B>(size: usize) -> CircularBuffer<B>[src]
pub fn new<B>(size: usize) -> CircularBuffer<B>Creates a new CircularBuffer with fixed size
pub fn push(&mut self, elem: A) -> Option<A>[src]
pub fn push(&mut self, elem: A) -> Option<A>Add a value to the CircularBuffer Returns the popped value if the buffer is full
pub fn queue(&self) -> &VecDeque<A>[src]
pub fn queue(&self) -> &VecDeque<A>Get an immutable reference to the values inside the CircularBuffer
Auto Trait Implementations
impl<A> Send for CircularBuffer<A> where
A: Send,
impl<A> Send for CircularBuffer<A> where
A: Send, impl<A> Sync for CircularBuffer<A> where
A: Sync,
impl<A> Sync for CircularBuffer<A> where
A: Sync,