Fixed-Queue

A heapless version of the Rust Vec, VecDeque.

nostd, noalloc, use [T; N].

support Vec/VecDeque/spsc/History.

Usage

Vec

```rust use fixed_queue::Vec;

let mut vec: Vec = Vec::new(); asserteq!(vec.capacity(), 3); assert!(vec.isempty()); vec.push(1); println!("{}", vec[0]); println!("{:?}", vec.pop()); ```

VecDeque

```rust use fixed_queue::VecDeque;

let mut vec: VecDeque = VecDeque::new(); asserteq!(vec.capacity(), 3); assert!(vec.isempty()); vec.pushback(1); println!("{}", vec[0]); vec.pushfront(2); println!("{}", vec[1]); println!("{:?}", vec.popback()); println!("{:?}", vec.popfront()); ```

SPSC

```rust use fixed_queue::Spsc; static SPSC: Spsc = Spsc::new();

let sender = SPSC.takesender().unwrap(); let recver = SPSC.takerecver().unwrap();

asserteq!(SPSC.capacity(), 3); assert!(sender.send(1).isok()); assert!(sender.send(2).isok()); assert!(sender.send(3).isok()); assert!(sender.send(4).is_err()); ```

History

```rust use fixed_queue::History; static HISTORY: History = History::new();

assert!(HISTORY.insert(1)); assert!(HISTORY.contains(&1)); ```