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