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 memory;
12mod mutation;
13mod snapshot;
14mod traits;
15pub mod types;
16mod varint;
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::{
46    InMemoryGraph, NodeBatch, RelationshipBatch, SnapshotCatalogs, SnapshotEncoder,
47    SnapshotGraphBuilder, SnapshotNames, SnapshotNode, SnapshotRelationship,
48};
49
50// Value dictionary carried by snapshots (see `SnapshotNames`).
51pub use dict::{ValueDictionary, ValueKeyState};
52
53// ---------- Memory-footprint diagnostics ----------
54//
55// Debug-only retained-heap breakdown of an `InMemoryGraph`. Used by
56// the memory benchmark in `lora-database/benches/memory.rs` and the
57// `mem_probe*` examples to attribute observed RSS growth to a
58// specific component.
59pub use memory::{property_value_heap_bytes, MemoryReport, PropertyIndexKeyUsage};
60
61// ---------- Property-key interning ----------
62//
63// Re-exported flat so callers building `Properties` can write
64// `lora_store::intern("name")` instead of importing the submodule.
65pub use intern::{intern, intern_owned};
66
67// ---------- Index catalog (CREATE INDEX surface) ----------
68pub use memory::{
69    CreateIndexError, CreateIndexOutcome, DistinctValues, DropIndexError, DropIndexOutcome,
70    GraphStats, IndexCatalog, IndexConfigValue, IndexDefinition, IndexRequest, ListElementStats,
71    PlanSignature, StoredIndexEntity, StoredIndexKind, StoredIndexState, VectorBackendSnapshot,
72    VectorIndexSnapshot,
73};
74
75// ---------- Constraint catalog (CREATE CONSTRAINT surface) ----------
76pub use memory::{
77    ConstraintBacking, ConstraintCatalog, ConstraintDefinition, ConstraintRequest,
78    ConstraintViolation, CreateConstraintError, CreateConstraintOutcome, DropConstraintError,
79    DropConstraintOutcome, StoredConstraintKind, StoredPropertyType, StoredPropertyTypeTerm,
80    StoredScalarType, StoredVectorCoordType,
81};
82
83// ---------- Mutation stream vocabulary ----------
84pub use mutation::{ClosureRecorder, DeletedRecordSink, MutationEvent, MutationRecorder};
85
86// ---------- Snapshot vocabulary (codec lives in `lora-snapshot`) ----------
87pub use snapshot::{SnapshotError, SnapshotMeta, SnapshotPayload};