#intrusive #rb-tree #list #memory-management #no-std

no-std intrusive-collections

Intrusive collections for Rust (linked list and red-black tree)

37 releases

0.9.6 Jul 30, 2023
0.9.5 Jan 26, 2023
0.9.4 May 24, 2022
0.9.3 Dec 20, 2021
0.1.0 Feb 22, 2016

#37 in Data structures

Download history 12693/week @ 2023-12-11 10693/week @ 2023-12-18 6315/week @ 2023-12-25 9374/week @ 2024-01-01 16193/week @ 2024-01-08 14244/week @ 2024-01-15 13552/week @ 2024-01-22 13237/week @ 2024-01-29 14431/week @ 2024-02-05 14001/week @ 2024-02-12 12308/week @ 2024-02-19 12227/week @ 2024-02-26 15031/week @ 2024-03-04 16348/week @ 2024-03-11 20378/week @ 2024-03-18 19662/week @ 2024-03-25

72,105 downloads per month
Used in 327 crates (16 directly)

Apache-2.0/MIT

355KB
8K SLoC

intrusive-collections

Build Status Coverage Status Crates.io

A Rust library for creating intrusive collections. Currently supports singly-linked and doubly-linked lists, as well as red-black trees.

Features

  • Compatible with #[no_std].
  • Intrusive collections don't require any dynamic memory allocation since they simply keep track of existing objects rather than allocating new ones.
  • You can safely manipulate intrusive collections without any unsafe code.
  • A single object can be a member of multiple intrusive collections simultaneously.
  • Intrusive collections provide a Cursor-based interface, which allows safe mutation while iterating.

For examples and more information, see the documentation (crates.io, master).

Usage

Add this to your Cargo.toml:

[dependencies]
intrusive-collections = "0.9"

This crate has two Cargo features:

  • nightly: Enables nightly-only features: const fn constructors for collections (Link constructors are always const fn)
  • alloc (enabled by default): Implements IntrusivePointer for Box, Rc and Arc.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies