| Crates.io | ida-rs |
| lib.rs | ida-rs |
| version | 0.1.1 |
| created_at | 2025-10-20 07:21:47.149825+00 |
| updated_at | 2025-10-20 09:08:58.161416+00 |
| description | A thread-safe, no_std, sparse ID allocator using a radix tree. Ideal for systems programming. |
| homepage | |
| repository | https://github.com/TomGoh/ida-rs |
| max_upload_size | |
| id | 1891544 |
| size | 36,566 |
ida-rs provides a thread-safe, no_std compatible ID allocator suitable for
systems-level programming, such as in OS kernels or embedded environments.
It is implemented as a radix tree, which makes it highly memory-efficient when dealing with sparse ID allocations (e.g., allocating ID 5 and ID 5,000,000 without allocating the space in between).
no_std compatible: Usable in bare-metal environments.use ida_rs::Ida;
let ida = Ida::new();
// Allocate new IDs
let id1 = ida.alloc().unwrap();
let id2 = ida.alloc().unwrap();
assert_eq!(id1, 0);
assert_eq!(id2, 1);
// Free an ID
ida.free(id1);
// The next allocation reuses the freed ID
let id3 = ida.alloc().unwrap();
assert_eq!(id3, 0);
This project is licensed under either of
LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)LICENSE-MIT or http://opensource.org/licenses/MIT)at your option.