All Projects → andylokandy → arraydeque

andylokandy / arraydeque

Licence: MIT license
A circular buffer with fixed capacity (Rust).

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to arraydeque

Staticvec
Implements a fixed-capacity stack-allocated Vec alternative backed by an array, using const generics.
Stars: ✭ 236 (+187.8%)
Mutual labels:  stack, no-std
flask-powered
List of companies using Flask framework - who is using Flask?
Stars: ✭ 123 (+50%)
Mutual labels:  stack
fastrq
Queue, Stack and Priority Queue built on Redis.
Stars: ✭ 15 (-81.71%)
Mutual labels:  stack
uniprof
A stack tracer/profiler for Xen domains
Stars: ✭ 29 (-64.63%)
Mutual labels:  stack
Ripple-Auto-Installer
OSU! Ripple Stack Installation Helper
Stars: ✭ 21 (-74.39%)
Mutual labels:  stack
cast.rs
Machine scalar casting that meets your expectations
Stars: ✭ 70 (-14.63%)
Mutual labels:  no-std
shoki
Purely functional data structures in Java
Stars: ✭ 30 (-63.41%)
Mutual labels:  stack
cassette
A simple, single-future, non-blocking executor intended for building state machines. Designed to be no-std and embedded friendly.
Stars: ✭ 47 (-42.68%)
Mutual labels:  no-std
stack
🥭 nxpm-stack lets you generate a complete and opinionated full-stack application in a Nx Workspace, ready to extend and deploy!
Stars: ✭ 98 (+19.51%)
Mutual labels:  stack
takomo
Organize, parameterize and deploy your CloudFormation stacks
Stars: ✭ 27 (-67.07%)
Mutual labels:  stack
Algorithms
Data Structures & Algorithms. Includes solutions for Cracking the Coding Interview 6th Edition
Stars: ✭ 89 (+8.54%)
Mutual labels:  stack
Competitive Programming
Contains solutions and codes to various online competitive programming challenges and some good problems. The links to the problem sets are specified at the beginning of each code.
Stars: ✭ 65 (-20.73%)
Mutual labels:  stack
DEPRECATED-data-structures
A collection of powerful data structures
Stars: ✭ 2,648 (+3129.27%)
Mutual labels:  stack
ult
The Ultimate Dev Stack
Stars: ✭ 54 (-34.15%)
Mutual labels:  stack
odin
High level 2d game engine written in Haskell.
Stars: ✭ 28 (-65.85%)
Mutual labels:  stack
deque
JavaScript implementation of a double-ended queue
Stars: ✭ 17 (-79.27%)
Mutual labels:  stack
TIFFStack
Load TIFF files into matlab fast, with lazy loading
Stars: ✭ 32 (-60.98%)
Mutual labels:  stack
flutter examples
Random flutter examples
Stars: ✭ 18 (-78.05%)
Mutual labels:  stack
StackFlowView
Enforce stack behaviour for custom UI flow.
Stars: ✭ 35 (-57.32%)
Mutual labels:  stack
Competitive Coding
Contains Solution for all type of Problems of Competitive Programming. Updates Frequently as any problem is solved.
Stars: ✭ 16 (-80.49%)
Mutual labels:  stack

arraydeque

build status crates.io docs.rs

A circular buffer with fixed capacity. Requires Rust 1.20+.

This crate is inspired by bluss/arrayvec

Documentation

Usage

First, add the following to your Cargo.toml:

[dependencies]
arraydeque = "0.4"

Next, add this to your crate root:

extern crate arraydeque;

Currently arraydeque by default links to the standard library, but if you would instead like to use arraydeque in a #![no_std] situation or crate you can request this via:

[dependencies]
arraydeque = { version = "0.4", default-features = false }

Example

extern crate arraydeque;

use arraydeque::ArrayDeque;

fn main() {
    let mut deque: ArrayDeque<[_; 2]> = ArrayDeque::new();
    assert_eq!(deque.capacity(), 2);
    assert_eq!(deque.len(), 0);

    deque.push_back(1);
    deque.push_back(2);
    assert_eq!(deque.len(), 2);

    assert_eq!(deque.pop_front(), Some(1));
    assert_eq!(deque.pop_front(), Some(2));
    assert_eq!(deque.pop_front(), None);
}

Changelog

  • 0.4.5 Update generic-array to 0.12.

  • 0.4.4 Fix UB: Some(ArrayDeque::new(xs)).is_some() == false. (#12)

  • 0.4.3 Add support for generic-array under use_generic_array feature.

  • 0.4.1 Capacity now equal to backend_array.len().

  • 0.3.1 Add behaviors: Saturating and Wrapping.

Contribution

All kinds of contribution are welcomed.

  • Issues. Feel free to open an issue when you find typos, bugs, or have any question.
  • Pull requests. New collection, better implementation, more tests, more documents and typo fixes are all welcomed.

License

Licensed under MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].