Expand description
The persistence contract for the DeepCausality context.
A Context in deep_causality_context lives in memory. This crate declares what a store
holds to keep one: the records a context projects onto (ContextoidRecord,
RelationRecord, ContextSnapshot and the NodeRecord tree under them), the
ContextStorage trait a backend implements, the Recordable projection the context crate
implements beside its node types, the Substrate a reference-holding store keeps values in,
and the ContextStorageStream a backend adds when it reports changes. Every scalar in a
record is f64 and every tick u64; every identifier is a u64 the store hands out. The
crate depends on ultragraph_traits alone, itself dependency-free, so that RelationKind
implements EdgeKey; a backend links these two crates and never the context crate.
utils_test holds an in-memory backend for tests on both sides of the contract.
See https://docs.deepcausality.com/ for the documentation.
Modules§
- utils_
test - Test utilities: an in-memory backend for both storage traits, an in-memory substrate, and a runtime-free way to drive the asynchronous contract.
Structs§
- Context
Record - A stored context: its identifier and its name.
- Context
Snapshot - One context as a store returns it: the container, its nodes, the edges among them, and the contexts it references, materialised one level deep.
- Contextoid
Record - A stored contextoid: its identifier and its payload.
- Extra
Context Snapshot - A context a stored context references, materialised: the referenced container’s identifier and name, its nodes, and the edges among them.
- IdReserve
- Identifiers a store has made unique and handed out for nodes not yet created.
- Memory
Storage Error - A refusal of the in-memory backend, one variant per rule of the storage contract it enforces.
- Memory
Substrate Error - A refusal of the in-memory substrate.
- Projection
Error - Why a record could not be read into a node type, or a node type written into a record.
- Relation
Record - A stored edge: the two contextoids it joins, by identifier, and the relation it carries.
- Substrate
Ref - Where a data node’s value is stored, for a context that outlives the process.
Enums§
- Container
Ref - Names a container inside a commit: one the store holds, or one the same commit creates.
- Context
Event - One change to a store. The same type flows both ways: a store reports every variant, and a
host requests one through
ContextStorageStream::apply. - Context
Write - One write of a
ContextStorage::commit. Each variant is the storage operation of the same name, under the same refusals; a container is named by aContainerRef, so a commit can link into and attach a container it creates. - Data
Record - The payload of a data node, as a store holds it.
- Memory
Storage Error Enum - The classification of an in-memory backend refusal.
- Memory
Substrate Error Enum - The classification of an in-memory substrate refusal.
- Node
Record - A contextoid’s payload as a store holds it: one variant per
ContextoidTypevariant. - Projection
Error Enum - The classification of a projection failure.
- Relation
Kind - The kind of relation an edge in a
Contextcarries. - Space
Record - A space node as a store holds it: one variant per
SpaceKindvariant. Every position is named, never positional. - Space
Time Record - A spacetime node as a store holds it: one variant per
SpaceTimeKindvariant. - Time
Record - A time node as a store holds it: one variant per
TimeKindvariant. - Time
Scale - Vertical
Datum - The reference an altitude is measured against.
Constants§
- RECORD_
VERSION - The shape version of the records.
Traits§
- Context
Events - A stream of events in the order a store committed them.
- Context
Storage - What a store of contexts does. Every operation is persistent; the crate’s name says so, and no operation name repeats it.
- Context
Storage Stream - A store that also reports changes as they commit and accepts a host’s changes in order.
- Recordable
- A context node type that one record describes completely, in both directions.
- Substrate
- A store that holds values and hands back references to them.
Type Aliases§
- Context
Event Item - One item of a stream: the cursor after an event and the event, the error that ended the stream,
or
Nonewhen it has ended. - Context
Id - The identifier of a stored context.
- Contextoid
Id - The identifier of a stored contextoid.
- Identification
Value - The primitive every record identifier is.