Skip to main content

Crate soil_rt

Crate soil_rt 

Source
Expand description

soil-rt — the Soil runtime.

Owns the value model, memory management (non-atomic reference counting; a runtime instance and all its values belong to one thread), derived operations, the canonical JSON bridge, and the C ABI for embedding. Everything else — soil0’s interpreter, compiled code, hosts — manipulates Soil values only through this crate. See docs/plans/impls/01-soil-rt-impl.md.

Re-exports§

pub use descriptor::FieldDesc;
pub use descriptor::IgnoredDefault;
pub use descriptor::Registry;
pub use descriptor::Strategy;
pub use descriptor::TypeBody;
pub use descriptor::TypeDesc;
pub use descriptor::TypeId;
pub use descriptor::TypeShape;
pub use descriptor::VariantDesc;
pub use descriptor_json::descriptors_to_json;
pub use descriptor_json::load_descriptors;
pub use error::PanicKind;
pub use error::SoilError;
pub use error::TraceFrame;
pub use value::debug_live_values;
pub use value::Closure;
pub use value::MapOrder;
pub use value::MapVal;
pub use value::OpaqueVal;
pub use value::Record;
pub use value::Ref;
pub use value::SumVal;
pub use value::Value;

Modules§

capi
The C ABI (impl plan §4 step 8). Verbatim rules: no global state (SoilRuntime* is the instance); explicit init/teardown; no unwinding across the boundary — every entry point is wrapped in catch_unwind, and a caught panic becomes a SoilError of kind Internal.
descriptor
descriptor_json
Descriptors as data (impl plan §4 step 7), in the tr-grammar §7 conventions — internally tagged sums, records — as if descriptors were already Soil values. Named shapes serialize by name (ids are per-instance); loading is two-pass (declare all, then define all), which handles recursive types for free.
error
json
The canonical JSON bridge (tr-grammar §7).
ops
The derived operations (design §3.7): structural eq, compare, and hash over Value + descriptor. show is the canonical JSON encoder (json::encode).
value

Structs§

Runtime
One Soil runtime instance: the type registry and (in debug builds) the allocation accounting. No global state — embedders hold this and pass it explicitly; over the C ABI it is the SoilRuntime* handle. An instance and every value created under it belong to one thread.