Skip to main content

sim_lib_mutation/
lib.rs

1#![forbid(unsafe_code)]
2#![deny(missing_docs)]
3//! Mutation behavior for the SIM runtime: cells, boxes, vectors, symbol-keyed
4//! tables, and runtime-keyed tables.
5//!
6//! The kernel defines the capability and operation contracts; this crate
7//! supplies the concrete mutation organ (mutable cells, boxes, vectors,
8//! symbol-keyed tables, and runtime-keyed tables) guarded by a standard mutate
9//! capability. Every in-place write goes through
10//! [`standard_mutate_capability`] so mutation stays auditable, and the organ
11//! publishes its operation keys as claims via
12//! [`publish_mutation_organ_claims`].
13//!
14//! See the crate [README] for where this organ sits in the constellation.
15//!
16//! [README]: https://github.com/sim-nest/sim-runtime
17
18mod cap;
19mod cell;
20mod claims;
21mod runtime_key;
22mod runtime_table;
23mod table;
24mod vector;
25
26pub use cap::standard_mutate_capability;
27pub use cell::{Cell, MutableBox, cell_value, mutable_box_value};
28pub use claims::{
29    mutation_box_op_key, mutation_cell_op_key, mutation_op_keys, mutation_organ_symbol,
30    mutation_set_op_key, mutation_table_op_key, mutation_vector_op_key,
31    publish_mutation_organ_claims, publish_mutation_organ_claims_for_lib,
32};
33pub use runtime_key::{PrimitiveRuntimeKeyPolicy, RuntimeKey, RuntimeKeyPolicy};
34pub use runtime_table::{MutableRuntimeTable, mutable_runtime_table, mutable_runtime_table_value};
35pub use table::{MutableTable, mutable_table, mutable_table_value};
36pub use vector::{MutableVector, mutable_vector, mutable_vector_from_value, mutable_vector_value};
37
38/// Cookbook recipes for this lib, embedded at build time.
39pub static RECIPES: sim_cookbook::EmbeddedDir =
40    include!(concat!(env!("OUT_DIR"), "/cookbook_recipes.rs"));
41
42#[cfg(test)]
43mod tests;