Expand description
AtomVM Atom Table Interface
This module provides safe Rust bindings to the AtomVM atom table, allowing Ports and NIFs to interact with the VM’s atom storage system.
§Design Philosophy
This module uses dependency injection throughout - no global state.
All operations take an impl AtomTableOps parameter, making the code
generic and testable with any atom table implementation.
§Examples
ⓘ
use avmnif_rs::atom::{AtomTableOps, AtomTable};
// In production - use real AtomVM table
let atom_table = AtomTable::new(context);
let hello_atom = atom_table.ensure_atom_str("hello")?;
// In testing - use mock table
let atom_table = MockAtomTable::new();
let hello_atom = atom_table.ensure_atom_str("hello")?;
// Both work the same way!Modules§
- atoms
- Utilities for working with common atoms
Structs§
- Atom
Index - Index into the atom table
- AtomRef
- Reference to atom data stored in the table
- Atom
Table - Opaque handle to the AtomVM atom table
Enums§
- Atom
Copy Opt - Copy options for atom insertion
- Atom
Error - Errors that can occur during atom operations
- Ensure
Atoms Opt - Options for bulk atom operations
Traits§
- Atom
Table Ops - Trait for atom table operations - the foundation of our generic design