| Crates.io | icentral-mindexed-map |
| lib.rs | icentral-mindexed-map |
| version | 0.1.0 |
| created_at | 2025-04-04 20:46:26.031449+00 |
| updated_at | 2025-04-04 20:46:26.031449+00 |
| description | A versatile Rust crate for managing collections with dual functionalities: index-based and map-based data structures, supporting both dense and sparse implementations efficiently. |
| homepage | |
| repository | |
| max_upload_size | |
| id | 1620723 |
| size | 59,720 |
icentral-mindexed-map is a Rust crate providing a versatile data structure with dual functionalities: indexed and mapped collections. This crate offers the ability to seamlessly transition between vector-based indexed storage and hash map-based key-value storage. The primary goal of this crate is to offer flexibility and efficiency in handling collections, catering to varying needs of index-based and key-based data storage.
NodeId.Vec<T> or a mapped representation using HashMap<NodeId, T>.
Indexed(Vec<T>): Utilizes a sequential vector for storage, suited for dense data.Mapped(HashMap<NodeId, T>): Uses a hash map, ideal for sparse structures.MaybeIndexedMap, providing efficient traversal of both representations.use icentral_mindexed_map::{MaybeIndexedMap, NodeId};
fn main() {
let mut indexed_map = MaybeIndexedMap::new(5, 10);
indexed_map.set(NodeId::new(3), 20);
println!("Indexed Map: {:?}", indexed_map);
let mut mapped = MaybeIndexedMap::<i32>::default();
mapped.set(NodeId::new(1), 42);
mapped.set(NodeId::new(2), 99);
println!("Mapped: {:?}", mapped);
}
This README is generated by an AI model and may not be 100% accurate. However, it should provide you with a good understanding of the crate's purpose and capabilities.
This crate is licensed under the MIT License.
This crate is in the process of being translated from c++ to rust. Currently, it still needs exhaustive testing. It is likely there currently exist many glitches which need to be fixed before proper usage. This crate is based on the original icentral program developed by Fuad Jamor. Please see the following repository for details: https://github.com/fjamour/icentral.
For progress updates, see the workspacer rust project.