freelist-rs

Free list for numeric values

4 releases

0.0.4 Oct 3, 2024
0.0.3 Oct 3, 2024
0.0.2 Sep 22, 2024
0.0.1 Sep 22, 2024
Download history 269/week @ 2024-09-18 70/week @ 2024-09-25 230/week @ 2024-10-02 27/week @ 2024-10-09

596 downloads per month
Used in 3 crates (2 directly)

MIT license

5KB
77 lines

freelist-rs

A simple and efficient free list implementation in Rust, designed for managing the allocation and recycling of numeric IDs. Free numbers are recycled as late as possible to ensure minimal reuse over time, based on a Last In, First Out (LIFO) policy.

Features

  • LIFO-based recycling: Ensures that recently freed IDs are reused last
  • Customizable ID type: Supports any type that implements Copy, PartialEq, Debug, and From

Installation

Add the following to your Cargo.toml file:

[dependencies]
freelist-rs = "^0.0.3"

License

This library is licensed under the MIT License. See LICENSE for details.

No runtime deps