Skip to main content

Crate deep_causality_context_store

Crate deep_causality_context_store 

Source
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§

ContextRecord
A stored context: its identifier and its name.
ContextSnapshot
One context as a store returns it: the container, its nodes, the edges among them, and the contexts it references, materialised one level deep.
ContextoidRecord
A stored contextoid: its identifier and its payload.
ExtraContextSnapshot
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.
MemoryStorageError
A refusal of the in-memory backend, one variant per rule of the storage contract it enforces.
MemorySubstrateError
A refusal of the in-memory substrate.
ProjectionError
Why a record could not be read into a node type, or a node type written into a record.
RelationRecord
A stored edge: the two contextoids it joins, by identifier, and the relation it carries.
SubstrateRef
Where a data node’s value is stored, for a context that outlives the process.

Enums§

ContainerRef
Names a container inside a commit: one the store holds, or one the same commit creates.
ContextEvent
One change to a store. The same type flows both ways: a store reports every variant, and a host requests one through ContextStorageStream::apply.
ContextWrite
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 a ContainerRef, so a commit can link into and attach a container it creates.
DataRecord
The payload of a data node, as a store holds it.
MemoryStorageErrorEnum
The classification of an in-memory backend refusal.
MemorySubstrateErrorEnum
The classification of an in-memory substrate refusal.
NodeRecord
A contextoid’s payload as a store holds it: one variant per ContextoidType variant.
ProjectionErrorEnum
The classification of a projection failure.
RelationKind
The kind of relation an edge in a Context carries.
SpaceRecord
A space node as a store holds it: one variant per SpaceKind variant. Every position is named, never positional.
SpaceTimeRecord
A spacetime node as a store holds it: one variant per SpaceTimeKind variant.
TimeRecord
A time node as a store holds it: one variant per TimeKind variant.
TimeScale
VerticalDatum
The reference an altitude is measured against.

Constants§

RECORD_VERSION
The shape version of the records.

Traits§

ContextEvents
A stream of events in the order a store committed them.
ContextStorage
What a store of contexts does. Every operation is persistent; the crate’s name says so, and no operation name repeats it.
ContextStorageStream
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§

ContextEventItem
One item of a stream: the cursor after an event and the event, the error that ended the stream, or None when it has ended.
ContextId
The identifier of a stored context.
ContextoidId
The identifier of a stored contextoid.
IdentificationValue
The primitive every record identifier is.