Skip to main content

nodedb_types/sync/wire/
mod.rs

1// SPDX-License-Identifier: Apache-2.0
2
3//! Sync wire protocol: frame format and message types.
4//!
5//! Frame format: `[msg_type: 1B][length: 4B LE][rkyv/msgpack body]`
6//!
7//! Message types:
8//! - `0x01` Handshake (client → server)
9//! - `0x02` HandshakeAck (server → client)
10//! - `0x10` DeltaPush (client → server)
11//! - `0x11` DeltaAck (server → client)
12//! - `0x12` DeltaReject (server → client)
13//! - `0x13` CollectionSchema (bidirectional)
14//! - `0x14` CollectionPurged (server → client)
15//! - `0x20` ShapeSubscribe (client → server)
16//! - `0x21` ShapeSnapshot (server → client)
17//! - `0x22` ShapeDelta (server → client)
18//! - `0x23` ShapeUnsubscribe (client → server)
19//! - `0x30` VectorClockSync (bidirectional)
20//! - `0x40` TimeseriesPush (client → server)
21//! - `0x41` TimeseriesAck (server → client)
22//! - `0x50` ResyncRequest (bidirectional)
23//! - `0x52` Throttle (client → server)
24//! - `0x60` TokenRefresh (client → server)
25//! - `0x61` TokenRefreshAck (server → client)
26//! - `0x70` DefinitionSync (server → client)
27//! - `0x80` PresenceUpdate (client → server)
28//! - `0x81` PresenceBroadcast (server → all subscribers)
29//! - `0x82` PresenceLeave (server → all subscribers)
30//! - `0x90` ArrayDelta (client → server)
31//! - `0x91` ArrayDeltaBatch (client → server)
32//! - `0x92` ArraySnapshot (server → client)
33//! - `0x93` ArraySnapshotChunk (server → client)
34//! - `0x94` ArraySchema (bidirectional)
35//! - `0x95` ArrayAck (client → server)
36//! - `0x96` ArrayReject (server → client)
37//! - `0x97` ArrayCatchupRequest (client → server)
38//! - `0xA0` ColumnarInsert (client → server)
39//! - `0xA1` ColumnarInsertAck (server → client)
40//! - `0xA2` VectorInsert (client → server)
41//! - `0xA3` VectorInsertAck (server → client)
42//! - `0xA4` VectorDelete (client → server)
43//! - `0xA5` VectorDeleteAck (server → client)
44//! - `0xA6` FtsIndex (client → server)
45//! - `0xA7` FtsIndexAck (server → client)
46//! - `0xA8` FtsDelete (client → server)
47//! - `0xA9` FtsDeleteAck (server → client)
48//! - `0xAA` SpatialInsert (client → server)
49//! - `0xAB` SpatialInsertAck (server → client)
50//! - `0xAC` SpatialDelete (client → server)
51//! - `0xAD` SpatialDeleteAck (server → client)
52//! - `0xFF` Ping/Pong (bidirectional)
53
54pub mod ack_result;
55pub mod ack_status;
56pub mod array;
57pub mod collection_schema;
58pub mod columnar;
59pub mod delta;
60pub mod frame;
61pub mod fts;
62pub mod presence;
63pub mod provenance;
64pub mod resync;
65pub mod session;
66pub mod shape;
67pub mod spatial;
68pub mod stream_id;
69pub mod timeseries;
70pub mod vector;
71
72#[cfg(test)]
73mod tests;
74
75pub use ack_result::SyncAckResult;
76pub use ack_status::AckStatus;
77pub use array::{
78    ArrayAckMsg, ArrayCatchupRequestMsg, ArrayDeltaBatchMsg, ArrayDeltaMsg, ArrayRejectMsg,
79    ArrayRejectReason, ArraySchemaSyncMsg, ArraySnapshotChunkMsg, ArraySnapshotMsg,
80};
81pub use collection_schema::{CollectionDescriptor, CollectionSchemaSyncMsg};
82pub use columnar::{ColumnarInsertAckMsg, ColumnarInsertMsg};
83pub use delta::{CollectionPurgedMsg, DeltaAckMsg, DeltaPushMsg, DeltaRejectMsg};
84pub use frame::{SyncFrame, SyncMessageType};
85pub use fts::{FtsDeleteAckMsg, FtsDeleteMsg, FtsIndexAckMsg, FtsIndexMsg};
86pub use presence::{PeerPresence, PresenceBroadcastMsg, PresenceLeaveMsg, PresenceUpdateMsg};
87pub use provenance::SyncProvenance;
88pub use resync::{ResyncReason, ResyncRequestMsg, ThrottleMsg};
89pub use session::{
90    HandshakeAckMsg, HandshakeMsg, PingPongMsg, TokenRefreshAckMsg, TokenRefreshMsg,
91};
92pub use shape::{
93    ShapeDeltaMsg, ShapeSnapshotMsg, ShapeSubscribeMsg, ShapeUnsubscribeMsg, VectorClockSyncMsg,
94};
95pub use spatial::{SpatialDeleteAckMsg, SpatialDeleteMsg, SpatialInsertAckMsg, SpatialInsertMsg};
96pub use stream_id::{EngineKind, stream_id_for};
97pub use timeseries::{DefinitionSyncMsg, TimeseriesAckMsg, TimeseriesPushMsg};
98pub use vector::{VectorDeleteAckMsg, VectorDeleteMsg, VectorInsertAckMsg, VectorInsertMsg};