substrate_data/model/atom/mod.rs
1//! Atoms: names that repeat across messages (`core:open`, a live
2//! record's state) kept once a process and sent in frames as their number.
3//! An [`Atom`] is a `u32`: copied, compared and packed as one; its text is
4//! the table's, alive as long as the process. A frame carries the number,
5//! every other form (text, the tagged binary form, files) the text — the
6//! numbers mean nothing outside the process.
7//!
8//! The table is the host's: a plugin's copy of this crate (another dynamic
9//! library) is pointed at it ([`install`]) so every plugin and the host
10//! agree on the numbers. Without one (tools, tests) the crate keeps its own.
11//!
12//! ```
13//! use substrate_data::Atom;
14//!
15//! let open = Atom::new("core:open");
16//! assert_eq!(open, Atom::new("core:open"));
17//! assert_eq!(open.as_str(), "core:open");
18//! ```
19
20#[expect(clippy::module_inception, reason = "the atom module's one type")]
21mod atom;
22pub mod local;
23mod table;
24
25pub use atom::Atom;
26pub use table::{Table, install};