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