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;
20pub mod realtime_round;
21pub mod schema;
22pub mod transport;
23pub mod values;
24
25pub use api::{
26 ClientLimits, ConflictRecord, Mutation, PresencePeer, RejectionRecord, RowState, SchemaFloor,
27 SubscriptionStateView, SyncOutcome, SyncReport, WindowBase,
28};
29pub use client::SyncClient;
30pub use schema::{compile_schema, parse_schema_json, ClientSchema};
31pub use transport::{BlobDownload, BlobUploadGrant, SegmentRequest, Transport, TransportError};
32
33// Re-export the SSP2 stream scanner (§8.7 round-response reassembly) so the
34// native transports (FFI + Tauri plugin) reach it through their existing
35// `syncular-client` dependency, without each adding a direct `ssp2` path dep.
36pub use realtime_round::{RealtimeRound, RoundInbound, REALTIME_TAG_DELTA, REALTIME_TAG_ROUND};
37pub use ssp2::{MessageStreamScanner, ScannedMessage};