Skip to main content

Module ldm_storage

Module ldm_storage 

Source
Expand description

LDM in-memory storage — ItsDataObject, StoredRecord, LdmStore.

LdmStore is the sole mutable state of the LDM; it is always wrapped in Arc<RwLock<LdmStore>> so that readers (queries, subscription checks) can proceed concurrently while writers (insert / update / delete) hold an exclusive lock.

§Design choices

  • ItsDataObject is a typed enum — zero runtime overhead; no dynamic dispatch, no heap-allocated trait objects, no schema-on-the-wire parsing.
  • HashMap<u64, StoredRecord> — O(1) lookup/insert/delete vs. the Python TinyDB O(n) list scans.
  • Record IDs are generated from a monotonically increasing u64 counter; they never repeat within a process lifetime.

Structs§

LdmStore
In-memory LDM record store.
StoredRecord
A single LDM record.

Enums§

ItsDataObject
A typed ITS data object stored in the LDM.