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, EdgeAllocationError, EdgeAllocator, EdgeId, EdgeKind,
36    EdgeLimits, EdgeSnapshot, EdgeVisitor, EphemeronMutationError, HardCappedRetainPolicy,
37    ManagedArena, ManagedHandle, ManagedId, ManagedNode, ManagedObject, ManagedRole,
38    RoleBearingManagedObject, RoleProjectionError, RoleProjectionReceipt, RootId, RootedHandle,
39    SafepointReceipt, StrongEdgeMutationError, TeardownReceipt, TraceContractVersion,
40    TraceSnapshot, TypedEdgeId, WeakEdgeMutationError, WeakHandle,
41};
42pub use runtime_key::{PrimitiveRuntimeKeyPolicy, RuntimeKey, RuntimeKeyPolicy};
43pub use runtime_table::{MutableRuntimeTable, mutable_runtime_table, mutable_runtime_table_value};
44pub use table::{MutableTable, mutable_table, mutable_table_value};
45pub use vector::{MutableVector, mutable_vector, mutable_vector_from_value, mutable_vector_value};
46
47/// Cookbook recipes for this lib, embedded at build time.
48pub static RECIPES: sim_cookbook::EmbeddedDir =
49    include!(concat!(env!("OUT_DIR"), "/cookbook_recipes.rs"));
50
51#[cfg(test)]
52mod managed_tests;
53#[cfg(test)]
54mod tests;