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, tables, and a
4//! bounded managed-object arena.
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 managed;
22mod runtime_key;
23mod runtime_table;
24mod table;
25mod vector;
26
27pub use cap::standard_mutate_capability;
28pub use cell::{Cell, MutableBox, cell_value, mutable_box_value};
29pub use claims::{
30    mutation_box_op_key, mutation_cell_op_key, mutation_op_keys, mutation_organ_symbol,
31    mutation_set_op_key, mutation_table_op_key, mutation_vector_op_key,
32    publish_mutation_organ_claims, publish_mutation_organ_claims_for_lib,
33};
34pub use managed::{
35    ArenaError, CollectionMutationReceipt, EdgeId, EdgeVisitor, HardCappedRetainPolicy,
36    ManagedArena, ManagedHandle, ManagedId, ManagedObject, RootId, RootedHandle, SafepointReceipt,
37    TeardownReceipt, TraceContractVersion, TraceSnapshot, WeakHandle,
38};
39pub use runtime_key::{PrimitiveRuntimeKeyPolicy, RuntimeKey, RuntimeKeyPolicy};
40pub use runtime_table::{MutableRuntimeTable, mutable_runtime_table, mutable_runtime_table_value};
41pub use table::{MutableTable, mutable_table, mutable_table_value};
42pub use vector::{MutableVector, mutable_vector, mutable_vector_from_value, mutable_vector_value};
43
44/// Cookbook recipes for this lib, embedded at build time.
45pub static RECIPES: sim_cookbook::EmbeddedDir =
46    include!(concat!(env!("OUT_DIR"), "/cookbook_recipes.rs"));
47
48#[cfg(test)]
49mod managed_tests;
50#[cfg(test)]
51mod tests;