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