syncular_client/lib.rs
1//! # syncular-client — Syncular v2 Rust client core (POC stage 2)
2//!
3//! A clean-room client implementation of the SPEC.md client-behavior
4//! contract on rusqlite local storage, consuming the committed `ssp2`
5//! codec as its wire layer. Built without reading the v1 Rust tree or the
6//! v2 TypeScript client — the conformance catalog (packages/conformance)
7//! is the proof that both cores implement one written protocol.
8//!
9//! The API is synchronous request/response: the host drives `sync()` /
10//! `sync_until_idle()` and feeds inbound realtime traffic through
11//! `on_realtime_text` / `on_realtime_binary`. Scheduling is host policy
12//! (§8.4); the core exposes the coalesced `sync_needed` signal only.
13
14pub mod api;
15pub mod client;
16/// §5.10.5 native CRDT helpers (the `crdt-yjs` feature) — the Rust face of the
17/// Yjs binding, mirroring `@syncular/crdt-yjs`. Off by default (dependency-lean).
18#[cfg(feature = "crdt-yjs")]
19pub mod crdt;
20/// Shared blocking HTTP/WebSocket host transport for Rust-backed bindings.
21/// The network stack is feature-gated; its no-network shape remains available
22/// in dependency-lean builds so host code needs only one transport type.
23pub mod native_transport;
24pub mod query_guard;
25pub mod realtime_round;
26pub mod schema;
27pub mod transport;
28pub mod values;
29
30pub use api::{
31 ClientChangeBatch, ClientLimits, CommandEffects, ConflictRecord, CoverageSnapshot, Mutation,
32 PresencePeer, QuerySnapshot, RejectionRecord, RowState, SchemaFloor, SubscriptionStateView,
33 SyncIntent, SyncOutcome, SyncReport, SyncStatusSnapshot, TableChange, WindowBase, WindowChange,
34 WindowCoverage, WindowState, WindowUnitRef,
35};
36pub use client::{FileQuerySnapshotReader, SyncClient};
37pub use schema::{compile_schema, parse_schema_json, ClientSchema};
38pub use transport::{BlobDownload, BlobUploadGrant, SegmentRequest, Transport, TransportError};
39
40// Re-export the SSP2 stream scanner (§8.7 round-response reassembly) so the
41// native transports (FFI + Tauri plugin) reach it through their existing
42// `syncular-client` dependency, without each adding a direct `ssp2` path dep.
43pub use realtime_round::{RealtimeRound, RoundInbound, REALTIME_TAG_DELTA, REALTIME_TAG_ROUND};
44pub use ssp2::{MessageStreamScanner, ScannedMessage};