cons-list
Singly-linked list implementation in Rust (by tranzystorekk)
index-list
A doubly-linked list implementation in safe Rust using vector indexes (by Fairglow)
cons-list | index-list | |
---|---|---|
1 | 3 | |
4 | 4 | |
- | - | |
0.0 | 4.6 | |
over 1 year ago | about 1 month ago | |
Rust | Rust | |
- | GNU Lesser General Public License v3.0 only |
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
cons-list
Posts with mentions or reviews of cons-list.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2022-02-05.
-
Simple stack implementation: unsafe's use case
For reference, here's my linked list: https://github.com/tranzystorek-io/cons-list, based on "too many linked lists", contains most features you'd expect from a collection, and is aimed to be fairly simple to understand
index-list
Posts with mentions or reviews of index-list.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2021-05-14.
-
Things you can’t do in Rust (and what to do instead)
If you switch pointers for indirect indexes, then you can quite easily make a purely safe doubly-linked list in Rust. I did that as a learning exercise and called it index_list (github), where all elements and nodes are stored in a vector (for improved locality). In my very short and non-general tests it performed better than the standard LinkedList implementation. It also provide you with an alternative way to iterate over the list with mutable access to its elements. It probably is not at the same level of quality as standard library things, as I'm quite new to Rust in general, but thought the design would be worth consideration in this context.
-
custom index for Vec<T> (eg 32bit indices in 64 bit)
I implemented a doubly-linked list in safe Rust, where I use Option as an Index type. This gives me an optional u32 in 4 bytes. You can find my lib.rs code on GitHub and it starts with the Index struct. It also implements From for u32, u64 and usize. Maybe you can take inspiration from there. In that code the user isn't supposed to create the Indexes themselves m but get them from the list as they traverse them. That is why most methods are private.
-
A doubly-linked list implemented in safe Rust, using vector indexes
The source code is available on: * GitHub: https://github.com/Fairglow/index-list * Crates.io: https://crates.io/crates/index_list
What are some alternatives?
When comparing cons-list and index-list you can also consider the following projects:
miri - An interpreter for Rust's mid-level intermediate representation
rfcs - RFCs for changes to Rust
serial_test - Allows for the creation of serialised Rust tests
too-many-lists - Learn Rust by writing Entirely Too Many linked lists
not-yet-awesome-embedded-rust - A collection of items that are not yet awesome in Embedded Rust
rental - Rust macro to generate self-referential structs