Skip to main content

linkrs_sync/
lib.rs

1//! Synchronization coordination for derived secondary indexes.
2//!
3//! Engine implementations live outside this crate: fulltext search in
4//! `linkrs-fulltext` and vector search in `simvec` plus `vector-client`.
5//! This crate owns only coordination: durable outbox staging, delivery,
6//! retry and rebuild orchestration, with thin per-engine coordinators on top.
7//! `vector_type_conv` is the single conversion point between transport-side
8//! filter types and index-side filter types.
9
10#[cfg(feature = "vector")]
11pub mod backend;
12pub mod batch;
13pub mod builder;
14pub mod checkpoint_manifest;
15pub mod circuit_breaker;
16#[cfg(feature = "fulltext")]
17pub mod coordinator;
18pub mod dead_letter_queue;
19pub mod manager;
20mod outbox;
21pub mod outbox_recovery;
22#[cfg(feature = "fulltext")]
23pub mod rebuild;
24#[cfg(any(feature = "fulltext", feature = "vector"))]
25pub mod rebuild_common;
26pub mod receiver;
27pub mod retry;
28pub mod runtime;
29pub mod sqlite_outbox;
30pub mod types;
31pub mod vector_error;
32#[cfg(feature = "vector")]
33pub mod vector_index_manager;
34#[cfg(feature = "vector")]
35pub mod vector_rebuild;
36#[cfg(feature = "vector")]
37pub mod vector_sync;
38#[cfg(feature = "vector")]
39pub mod vector_type_conv;
40
41#[cfg(feature = "vector")]
42pub use backend::BackendDeliveryPolicy;
43#[cfg(feature = "fulltext")]
44pub use batch::FulltextBatchProcessor;
45pub use batch::{BatchConfig, BatchError, BatchProcessor, TransactionBatchBuffer};
46pub use checkpoint_manifest::{
47    CheckpointManifest, CheckpointManifestManager, IndexManifestRef, OutboxSnapshotRef,
48    StorageFileRef, StorageSnapshotRef,
49};
50pub use circuit_breaker::{
51    with_circuit_breaker, CircuitBreaker, CircuitBreakerConfig, CircuitBreakerError,
52    CircuitBreakerStats, CircuitState,
53};
54#[cfg(feature = "fulltext")]
55pub use coordinator::{
56    ChangeContext, ChangeData, RecoveryResult, SyncCoordinator, SyncCoordinatorError,
57};
58pub use dead_letter_queue::{DeadLetterEntry, DeadLetterQueue, DeadLetterQueueConfig};
59pub use linkrs_config::SyncConfig;
60pub use manager::{
61    EdgeProps, EdgeRef, OutboxBackpressureConfig, OutboxConsumerConfig, SyncError, SyncManager,
62};
63pub use outbox::{OutboxPayload, OutboxStats};
64pub use outbox_recovery::{
65    find_latest_snapshot, find_latest_snapshot_at_or_before, live_database_exists, recover_outbox,
66    restore_latest_snapshot, restore_snapshot_sync, verify_live_database,
67};
68#[cfg(feature = "fulltext")]
69pub use rebuild::{
70    fulltext_edge_doc_basis, fulltext_field_index_id, fulltext_tag_index_id,
71    fulltext_vertex_doc_id, FulltextRebuildOptions, RebuildDoc, RebuildDocSource, RebuildEntity,
72};
73#[cfg(feature = "fulltext")]
74pub use receiver::FulltextReceiver;
75#[cfg(feature = "vector")]
76pub use receiver::VectorReceiver;
77pub use receiver::{ApplyReceipt, LateArrivalResult};
78pub use retry::{with_retry, RetryConfig};
79pub use sqlite_outbox::{
80    ClaimedEvent, DeadLetterRow, DegradedRangeRow, IndexSyncDiagnostics, OutboxSnapshot,
81    RebuildEvent, SqliteOutbox, SyncDiagnostics, TargetSyncDiagnostics,
82};
83pub use types::{ChangeType, IndexData, IndexOpKey, IndexOperation, IndexType};
84pub use vector_error::{VectorCoordinatorError, VectorError, VectorErrorKind};
85
86#[cfg(feature = "vector")]
87pub use vector_index_manager::{PublishOutcome, TempCollection, TempKey, VectorIndexManager};
88#[cfg(feature = "vector")]
89pub use vector_rebuild::{
90    vector_tag_index_id, VectorDocSource, VectorRebuildDoc, VectorRebuildOptions,
91};
92#[cfg(feature = "vector")]
93pub use vector_sync::{
94    VectorChangeContext, VectorChangeType, VectorEngineState, VectorIndexLocation, VectorPointData,
95    VectorSyncCoordinator,
96};
97
98#[cfg(feature = "vector")]
99pub use backend::VectorBackend;
100#[cfg(any(feature = "fulltext", feature = "vector"))]
101pub use rebuild_common::RebuildCommonOptions;
102#[cfg(feature = "vector")]
103pub use simvec::HealthStatus;
104
105// Re-export the remote client surface so downstream crates (root integration
106// tests, embedded API) can reference it without a direct vector-client
107// dependency. Only available with the qdrant feature.
108#[cfg(feature = "vector-qdrant")]
109pub use vector_client::{VectorClientConfig, VectorManager};