Skip to content

hamishs/ring-buffer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ring Buffer

A growable ring buffer implemented in Rust.

A ring buffer is a data type that stores an ordered array of elements which is efficient to insert/remove from both ends. The implementation is based on the description here as well as from the implementation of Vec described in the Rustonomicon. The API is a subset of the the standard library's VecDeque.

Usage

use ring_buffer::RingBuffer;

let mut ring_buffer = RingBuffer::new();
ring_buffer.push_front(1);
ring_buffer.push_front(2);

assert_eq!(ring_buffer.pop_back(), Some(1));

About

A growable ring buffer.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages