#list #rbtree #intrusive #no_std

no-std intrusive-collections

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

28 releases

✓ Uses Rust 2018 edition

0.8.3 Dec 1, 2019
0.8.2 Nov 22, 2019
0.8.1 Jun 21, 2019
0.7.8 Nov 26, 2018
0.1.0 Feb 22, 2016

#45 in Data structures

Download history 187/week @ 2019-08-18 481/week @ 2019-08-25 305/week @ 2019-09-01 184/week @ 2019-09-08 303/week @ 2019-09-15 236/week @ 2019-09-22 175/week @ 2019-09-29 220/week @ 2019-10-06 203/week @ 2019-10-13 157/week @ 2019-10-20 326/week @ 2019-10-27 240/week @ 2019-11-03 171/week @ 2019-11-10 255/week @ 2019-11-17 115/week @ 2019-11-24

925 downloads per month
Used in 1 crate

Apache-2.0/MIT

200KB
4.5K 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.8"

and this to your crate root:

#[macro_use]
extern crate intrusive_collections;

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. This requires libstd on stable, but only liballoc if the nightly feature is enabled.

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