Skip to main content

macrame/
lib.rs

1pub mod branch;
2pub mod connection;
3pub mod error;
4pub mod graph;
5pub mod integrity;
6pub mod metrics;
7pub mod plan;
8pub mod schema;
9pub mod temporal;
10pub mod util;
11pub mod vector;
12
13// `CHUNK_BUDGET` is re-exported at the root because four modules already write
14// `[`crate::CHUNK_BUDGET`]` in their rustdoc — an intra-doc link that resolved
15// to nothing, since the const lives in `connection`. The bound is the crate's
16// one cross-cutting number; the root is where a reader looks for it.
17pub use branch::{Branch, BranchId, BranchView, Divergence, MAX_BRANCH_ID};
18pub use connection::{
19    Annotation, BulkControl, BulkProgress, CadencePolicy, CancelToken, CheckpointReport,
20    ConceptUpsert, Database, Tuning, WalCheckpointPolicy, CHUNK_BUDGET,
21};
22pub use error::{BulkInterrupted, BulkResult, DbError, ErrorKind, Overlap, Result, StatedInstants};
23pub use plan::ReadPlan;
24pub use util::{FutureStampPolicy, DEFAULT_FUTURE_STAMP_TOLERANCE};
25
26pub mod prelude {
27    // Names, not namespaces (D-208). `chunk_rows` was in this list and is a
28    // *module*, so `prelude::chunk_rows::EDGES` was a second canonical path to
29    // all four constants and a second name for the module itself. A prelude
30    // exists so one `use` brings in the names a caller needs; it is not a
31    // second directory tree.
32    pub use crate::branch::{Branch, BranchId, MAX_BRANCH_ID};
33    pub use crate::connection::{
34        estimated_bulk_hold, Annotation, BulkControl, BulkProgress, CadencePolicy, CancelToken,
35        CheckpointReport, ConceptUpsert, Database, Tuning, WalCheckpointPolicy,
36        BULK_ATOMIC_WARN_HOLD, CHUNK_BUDGET, MAX_ARCHIVE_SESSIONS,
37    };
38    pub use crate::error::{
39        BulkInterrupted, BulkResult, DbError, ErrorKind, Overlap, Result, StatedInstants,
40    };
41    pub use crate::graph::{
42        AttributeMode, CandidateCount, CostEstimate, CostEstimator, EdgeAssertion,
43        FilteredVectorSearch, TraversalBuilder, VectorFilterStrategy, WalkOutcome,
44    };
45    pub use crate::integrity::{audit_current, rebuild_current, RebuildReport};
46    pub use crate::metrics::CommandKind;
47    #[cfg(feature = "metrics")]
48    pub use crate::metrics::{KindSnapshot, MetricsSnapshot};
49    pub use crate::plan::ReadPlan;
50    // `archive` names both a module and a function in `temporal`, and an
51    // explicit import binds the name in *both* namespaces. Listing it here
52    // re-exported the module too — and once that module is `pub(crate)`, this
53    // `pub use` republishes it as public at `prelude::archive`, with neither an
54    // error nor a warning. Naming the function's own path is what imports the
55    // function alone (D-208).
56    pub use crate::branch::Ancestor;
57    pub use crate::temporal::archive::archive;
58    pub use crate::temporal::{
59        query_as_of_edges, query_as_of_edges_on, reconstruct, reconstruct_on, resolve_beliefs,
60        ArchiveReport, EdgeBelief, Interval, MaterializedState, SnapshotCadence,
61    };
62    pub use crate::util::{
63        Clock, FakeClock, FutureStampPolicy, SystemClock, DEFAULT_FUTURE_STAMP_TOLERANCE,
64    };
65    pub use crate::vector::{
66        declared_dimension, escape_fts5_query, keyword_search, reciprocal_rank_fusion,
67        register_model, registered_models, search_vector, upsert_embedding, EmbeddingCodec,
68        HybridHit, HybridSearch, ModelName, VectorSearchResult, RRF_K,
69    };
70}