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