Rust Data structures

Open-source Rust projects categorized as Data structures

Top 23 Rust Data structure Projects

  • Rust

    All Algorithms implemented in Rust (by TheAlgorithms)

    Project mention: New colorscheme | reddit.com/r/neovim | 2022-11-03

    Oh, i didn't implement convex hull algorithm. And that was a random file i opened from the Rust-Algorithms repo, I contributed with some algos few months back!

  • crossbeam

    Tools for concurrent programming in Rust

    Project mention: This implementation is actually unsafe since we don't check if the index is in-bounds. But this is fine since this is only used internally. | reddit.com/r/rustjerk | 2022-12-26
  • InfluxDB

    Build time-series-based applications quickly and at scale.. InfluxDB is the Time Series Platform where developers build real-time applications for analytics, IoT and cloud-native services. Easy to start, it is available in the cloud or on-premises.

  • rust-algorithms

    Common data structures and algorithms in Rust

    Project mention: Anything C can do Rust can do Better | dev.to | 2022-12-01

    Algorithm Cookbook in Rust - Aram Ebtekar

  • hora

    🚀 efficient approximate nearest neighbor search algorithm collections library written in Rust 🦀 .

    Project mention: An efficient library for nearest neighbor search in native rust | news.ycombinator.com | 2022-03-27
  • dashmap

    Blazing fast concurrent HashMap for Rust.

    Project mention: Samsara, a safe Rust concurrent cycle collector | reddit.com/r/rust | 2023-01-04

    The problem is, every single one of these half-dozen crates has at least one known major issue (including UAF), exactly like C++ implementations (which isn't surprising since it's the kind of things where the ownership isn't clear and then the borrow checker can't help us).

  • heapless

    Heapless, `static` friendly data structures

    Project mention: """may_dangle""" stabilization | reddit.com/r/rust | 2022-10-26
  • rpds

    Rust Persistent Data Structures

    Project mention: Getting both a mutable and immutable reference to a shared structure? | reddit.com/r/rust | 2022-06-13

    Another option I can think of - but not completely sure how one would implement in Rust - would be to never mutate the shared state, but rather when updating it - completely swapping it out with a completely new copy of the desired state. There's lots of different ways to go about doing this - each with their own trade offs. But using some form of Persistent Data Structure would probably be a good way to start. If you only have a single writer - then I believe using a Cell and simply updating which version of the structure is being read could work. rpds seems to be a decent start to look at these sorts of structures in Rust.

  • SonarQube

    Static code analysis for 29 languages.. Your projects are multi-language. So is SonarQube analysis. Find Bugs, Vulnerabilities, Security Hotspots, and Code Smells so you can release quality code every time. Get started analyzing your projects today for free.

  • roaring-rs

    A better compressed bitset in Rust

    Project mention: Roaring-rs, better-compressed bitsets, is introducing faster multiple-bitmaps operations | reddit.com/r/rust | 2022-09-06
  • generic-array

    Generic array types in Rust

  • ImHex-Patterns

    Hex patterns, include patterns and magic files for the use with the ImHex Hex Editor

    Project mention: GitHub - WerWolv/ImHex: 🔍 A Hex Editor for Reverse Engineers, Programmers and people who value their retinas when working at 3 AM. | reddit.com/r/TheAmpHour | 2023-01-16
  • staticvec

    Implements a fixed-capacity stack-allocated Vec alternative backed by an array, using const generics.

    Project mention: Alternative for Vec for variable size arrays in no_std environment? | reddit.com/r/rust | 2022-05-17

    If you're on nightly, I have a crate that I'd say would seem to be exactly what you're looking for.

  • seize

    Fast, efficient, and robust memory reclamation for Rust.

    Project mention: Seize - Fast, efficient, and robust memory reclamation for Rust. | reddit.com/r/github_trends | 2022-05-10
  • graph

    A library for high-performant graph algorithms. (by s1ck)

    Project mention: Who ranks better? Memgraph vs. NetworkX PageRank | news.ycombinator.com | 2022-11-23

    This is a very interesting benchmark! I'd like to add a library to the comparison, which has recently been released.

    It's called graph-mate (https://pypi.org/project/graph-mate/) and it's a wrapper around a Rust implementation for parallel graph algorithms (https://crates.io/crates/graph) that a friend and I work on.

    We created a Jupyter notebook that loads the same Wikipedia articles and runs page rank with the same parameters: https://github.com/s1ck/graph/blob/d0a45116b1891daa39f493647...

  • hypergraph

    Hypergraph is data structure library to create a directed hypergraph in which a hyperedge can join any number of vertices.

    Project mention: Hypergraph - a data structure library to generate directed hypergraphs | reddit.com/r/rust | 2022-06-01

    Thanks! There's some benchmarks done here https://github.com/yamafaktory/hypergraph/blob/main/benches/performance.rs but you have to clone the project and test it locally. I can also move that to the CI workflow.

  • scapegoat

    Safe, fallible, embedded-friendly ordered set/map via a scapegoat tree. Validated against BTreeSet/BTreeMap. (by tnballo)

  • leapfrog

    Lock-free concurrent and single-threaded hash map implementations using Leapfrog probing. Currently the highest performance concurrent HashMap in Rust for certain use cases.

    Project mention: Leapfrog 0.2.0 (improved concurrent rust hashmap) | reddit.com/r/rust | 2022-03-15

    I'm announcing v 0.2.0 of leapfrog (crate), which adds new features and fixes the collision problems of the previous version. The performance is slightly reduced, but not by much and the maps are still very fast.

  • bimap-rs

    Generic bijective maps in Rust

    Project mention: BTreeMap but sorted by value? | reddit.com/r/rust | 2023-01-04

    Your requirements may be slightly different, but you could take a look at how e.g. bimap does it.

  • r3bl_rs_utils

    Redux store, TUI framework, non binary tree & graph data structures, proc macros, and more in Rust

    Project mention: [Media] TUI framework fans - I've just updated the r3bl_tui crate to v0.2.0. It now supports syntax highlighting, and compositor & double buffering for smooth rendering and no jank. It is inspired by React. https://crates.io/crates/r3bl_tui | reddit.com/r/rust | 2022-12-11
  • array_tool

    Array helpers for Rust's Vector and String types

  • triple-buffer

    Implementation of triple buffering in Rust

    Project mention: Rust Is Hard, Or: The Misery of Mainstream Programming | news.ycombinator.com | 2022-06-02

    Rust marks cross-thread shared memory as immutable in the general case, and allows you to define your own shared mutability constructs out of primitives like mutexes, atomics, and UnsafeCell. As a result you don't get rope to hang yourself with by default, but atomic orderings are more than enough rope to devise incorrect synchronizations (especially with more than 2 threads or memory locations). To quote an earlier post of mine:

    In terms of shared-memory threading concurrency, Send and Sync, and the distinction between &T and &Mutex and &mut T, were a revelation when I first learned them. It was a principled approach to shared-memory threading, with Send/Sync banning nearly all of the confusing and buggy entangled-state codebases I've seen and continue to see in C++ (much to my frustration and exasperation), and &Mutex providing a cleaner alternative design (there's an excellent article on its design at http://cliffle.com/blog/rust-mutexes/).

    My favorite simple concurrent data structure is https://docs.rs/triple_buffer/latest/triple_buffer/struct.Tr.... It beautifully demonstrates how you can achieve principled shared mutability, by defining two "handle" types (living on different threads), each carrying thread-local state (not TLS) and a pointer to shared memory, and only allowing each handle to access shared memory in a particular way. This statically prevents one thread from calling a method intended to run on another thread, or accessing fields local to another thread (since the methods and fields now live on the other handle). It also demonstrates the complexity of reasoning about lock-free algorithms (https://github.com/HadrienG2/triple-buffer/issues/14).

    I find that writing C++ code the Rust way eliminates data races practically as effectively as writing Rust code upfront, but C++ makes the Rust way of thread-safe code extra work (no Mutex unless you make one yourself, and you have to simulate &(T: Sync) yourself using T const* coupled with mutable atomic/mutex fields), whereas the happy path of threaded C++ (raw non-Arc pointers to shared mutable memory) leads to pervasive data races caused by missing or incorrect mutex locking or atomic synchronization.

  • yclass

    Inspect and recreate in-memory data structures

    Project mention: ReClass rewrite in rust but with field aligning | reddit.com/r/ReverseEngineering | 2022-12-04
  • ritelinked

    RiteLinked - LinkedHashMap & LinkedHashSet in Rust

  • NumToA

    An efficient method of heaplessly converting numbers into their string representations, storing the representation within a reusable byte array.

  • SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

NOTE: The open source projects on this list are ordered by number of github stars. The number of mentions indicates repo mentiontions in the last 12 Months or since we started tracking (Dec 2020). The latest post mention was on 2023-01-16.

Rust Data structures related posts

Index

What are some of the best open-source Data structure projects in Rust? This list will help you:

Project Stars
1 Rust 14,178
2 crossbeam 5,782
3 rust-algorithms 3,315
4 hora 2,299
5 dashmap 2,012
6 heapless 1,036
7 rpds 899
8 roaring-rs 559
9 generic-array 330
10 ImHex-Patterns 278
11 staticvec 268
12 seize 244
13 graph 237
14 hypergraph 228
15 scapegoat 222
16 leapfrog 146
17 bimap-rs 95
18 r3bl_rs_utils 79
19 array_tool 71
20 triple-buffer 69
21 yclass 59
22 ritelinked 53
23 NumToA 42
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com