Skip to main content

lora_store/
lib.rs

1//! Storage layer: graph value types, the trait surface every backend
2//! implements, and the in-memory reference backend.
3//!
4//! Public surface is laid out here so the full export of the crate is
5//! readable in one place.
6
7pub mod codec;
8pub mod intern;
9mod lock_table;
10mod memory;
11mod mutation;
12mod snapshot;
13mod traits;
14pub mod types;
15
16// ---------- Value types ----------
17//
18// Re-exported flat for convenience (`lora_store::LoraPoint`, etc.); the
19// `types` module is also `pub` so callers can opt for the namespaced
20// path (`lora_store::types::spatial::LoraPoint`) when they prefer it.
21pub use types::{
22    cartesian_distance, cosine_similarity_bounded, cosine_similarity_raw, days_in_month,
23    dot_product, euclidean_distance, euclidean_distance_squared, euclidean_norm,
24    euclidean_similarity, hamming_distance, haversine_distance, is_leap_year, manhattan_distance,
25    manhattan_norm, parse_string_values, point_distance, resolve_srid, resolve_srid_checked,
26    srid_from_crs_name, srid_is_3d, srid_is_geographic, srid_is_supported, ExpandedRelationship,
27    LoraBinary, LoraDate, LoraDateTime, LoraDuration, LoraLocalDateTime, LoraLocalTime, LoraPoint,
28    LoraTime, LoraVector, NamedPointCoordinates, NodeId, NodeRecord,
29    ParseVectorCoordinateTypeError, PointKeyFamily, Properties, PropertyMap, PropertyValue,
30    RawCoordinate, RelationshipId, RelationshipRecord, SridResolveError, VectorBuildError,
31    VectorCoordinateType, VectorValues, CRS_CARTESIAN, CRS_CARTESIAN_3D, CRS_WGS84_2D,
32    CRS_WGS84_3D, MAX_VECTOR_DIMENSION, SRID_CARTESIAN, SRID_CARTESIAN_3D, SRID_WGS84,
33    SRID_WGS84_3D,
34};
35
36// ---------- Storage trait surface ----------
37pub use traits::{BorrowedGraphStorage, GraphCatalog, GraphStorage, GraphStorageMut};
38
39// ---------- In-memory backend ----------
40pub use memory::InMemoryGraph;
41
42// ---------- Memory-footprint diagnostics ----------
43//
44// Debug-only retained-heap breakdown of an `InMemoryGraph`. Used by
45// the memory benchmark in `lora-database/benches/memory.rs` and the
46// `mem_probe*` examples to attribute observed RSS growth to a
47// specific component.
48pub use memory::{property_value_heap_bytes, MemoryReport};
49
50// ---------- Property-key interning ----------
51//
52// Re-exported flat so callers building `Properties` can write
53// `lora_store::intern("name")` instead of importing the submodule.
54pub use intern::{intern, intern_owned};
55
56// ---------- Index catalog (CREATE INDEX surface) ----------
57pub use memory::{
58    CreateIndexError, CreateIndexOutcome, DropIndexError, DropIndexOutcome, GraphStats,
59    IndexCatalog, IndexConfigValue, IndexDefinition, IndexRequest, StoredIndexEntity,
60    StoredIndexKind, StoredIndexState, VectorBackendSnapshot, VectorIndexSnapshot,
61};
62
63// ---------- Constraint catalog (CREATE CONSTRAINT surface) ----------
64pub use memory::{
65    ConstraintCatalog, ConstraintDefinition, ConstraintRequest, ConstraintViolation,
66    CreateConstraintError, CreateConstraintOutcome, DropConstraintError, DropConstraintOutcome,
67    StoredConstraintKind, StoredPropertyType, StoredPropertyTypeTerm, StoredScalarType,
68    StoredVectorCoordType,
69};
70
71// ---------- Mutation stream + write-set vocabulary ----------
72pub use mutation::{
73    ClosureRecorder, DeletedRecordSink, MutationEvent, MutationRecorder, MutationWriteSet,
74};
75
76// ---------- Concurrency primitives ----------
77pub use lock_table::{LockTable, WriteSetLocks, LOCK_TABLE_SHARDS};
78
79// ---------- Snapshot vocabulary (codec lives in `lora-snapshot`) ----------
80pub use snapshot::{SnapshotError, SnapshotMeta, SnapshotPayload};