swamp-slot-map

Crates.ioswamp-slot-map
lib.rsswamp-slot-map
version0.0.9
sourcesrc
created_at2024-11-09 10:33:06.070719
updated_at2024-11-09 10:33:06.070719
descriptionminimal slot map using index and generation
homepage
repositoryhttps://github.com/piot/swamp-render
max_upload_size
id1441970
size9,960
Peter Bjorklund (piot)

documentation

README

swamp-slot-map 🐊

swamp-slot-map is a fast, efficient, and flexible slot map implementation in Rust. A slot map is a data structure that stores values indexed by unique handles, with support for efficient insertion, removal, and iteration. It is commonly used in systems that need to manage collections of items dynamically, such as games or simulations.

✨ Features

  • Efficient Indexing: A slot map provides efficient lookups, insertions, and deletions by using indices and a generation counter.
  • Handle-Based Access: Items are accessed using handles, making it safe to insert and remove elements without worrying about invalid indices.
  • Iterators: Supports both immutable and mutable iteration over stored items.
  • Generational Handling: Ensures that handles are valid by tracking the generation of each index, preventing access to stale or removed items.
  • Thread Safety: Can be adapted for thread-safe usage with additional synchronization.

📦 Installation

To use swamp-slot-map, add it to your Cargo.toml:

[dependencies]
swamp-slot-map = "0.0.9"

License

This project is licensed under the MIT License - see the LICENSE file for details.

Commit count: 71

cargo fmt