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, NodeId, NodeRecord, ParseVectorCoordinateTypeError, PointKeyFamily,
29    Properties, PropertyValue, RawCoordinate, RelationshipId, RelationshipRecord, SridResolveError,
30    VectorBuildError, VectorCoordinateType, VectorValues, CRS_CARTESIAN, CRS_CARTESIAN_3D,
31    CRS_WGS84_2D, CRS_WGS84_3D, MAX_VECTOR_DIMENSION, SRID_CARTESIAN, SRID_CARTESIAN_3D,
32    SRID_WGS84, SRID_WGS84_3D,
33};
34
35// ---------- Storage trait surface ----------
36pub use traits::{BorrowedGraphStorage, GraphCatalog, GraphStorage, GraphStorageMut};
37
38// ---------- In-memory backend ----------
39pub use memory::InMemoryGraph;
40
41// ---------- Memory-footprint diagnostics ----------
42//
43// Debug-only retained-heap breakdown of an `InMemoryGraph`. Used by
44// the memory benchmark in `lora-database/benches/memory.rs` and the
45// `mem_probe*` examples to attribute observed RSS growth to a
46// specific component.
47pub use memory::{property_value_heap_bytes, MemoryReport};
48
49// ---------- Property-key interning ----------
50//
51// Re-exported flat so callers building `Properties` can write
52// `lora_store::intern("name")` instead of importing the submodule.
53pub use intern::{intern, intern_owned};
54
55// ---------- Index catalog (CREATE INDEX surface) ----------
56pub use memory::{
57    CreateIndexError, CreateIndexOutcome, DropIndexError, DropIndexOutcome, GraphStats,
58    IndexCatalog, IndexConfigValue, IndexDefinition, IndexRequest, StoredIndexEntity,
59    StoredIndexKind, StoredIndexState, VectorBackendSnapshot, VectorIndexSnapshot,
60};
61
62// ---------- Constraint catalog (CREATE CONSTRAINT surface) ----------
63pub use memory::{
64    ConstraintCatalog, ConstraintDefinition, ConstraintRequest, ConstraintViolation,
65    CreateConstraintError, CreateConstraintOutcome, DropConstraintError, DropConstraintOutcome,
66    StoredConstraintKind, StoredPropertyType, StoredPropertyTypeTerm, StoredScalarType,
67    StoredVectorCoordType,
68};
69
70// ---------- Mutation stream + write-set vocabulary ----------
71pub use mutation::{ClosureRecorder, MutationEvent, MutationRecorder, MutationWriteSet};
72
73// ---------- Concurrency primitives ----------
74pub use lock_table::{LockTable, WriteSetLocks, LOCK_TABLE_SHARDS};
75
76// ---------- Snapshot vocabulary (codec lives in `lora-snapshot`) ----------
77pub use snapshot::{SnapshotError, SnapshotMeta, SnapshotPayload};