| Crates.io | miden-utils-indexing |
| lib.rs | miden-utils-indexing |
| version | 0.20.2 |
| created_at | 2025-11-02 07:04:58.311079+00 |
| updated_at | 2026-01-06 22:27:30.315687+00 |
| description | Type-safe u32-indexed vector utilities for Miden |
| homepage | https://miden.xyz |
| repository | https://github.com/0xMiden/miden-vm |
| max_upload_size | |
| id | 1912769 |
| size | 14,422 |
Type-safe u32-indexed vector utilities for Miden.
This crate provides utilities for working with u32-indexed vectors in a type-safe manner, including the IndexVec type and related functionality.
A dense vector indexed by ID types that provides O(1) access and storage for dense ID-indexed data.
A dense mapping from ID to ID, equivalent to IndexVec<From, Option<To>>.
Create typed IDs using the newtype_id! macro:
use miden_utils_indexing::{IndexVec, newtype_id};
newtype_id!(UserId); // Creates a newtyped ID type
let mut users = IndexVec::<UserId, String>::new();
let alice_id = users.push("Alice".to_string()).unwrap();
let bob_id = users.push("Bob".to_string()).unwrap();
// Access by typed ID
println!("User: {}", users[alice_id]);
std (default): Enable standard library supportserde: Enable serialization/deserialization support