Skip to main content

ubiquisync_core/codec/
mod.rs

1//! Byte-level wire codec for log segments.
2//!
3//! A segment is an app-supplied magic header plus a sequence of entries. Each
4//! entry is one op (encoded through the [`Op`] trait), a delta-encoded
5//! timestamp, an optional user id (server mode), and a truncated blake3
6//! integrity check. The magic identifies the application and is supplied by
7//! the caller to [`Encoder::new`] / [`Decoder::new`].
8//!
9//! This module is generic over the op vocabulary `E: Op`: the framing here
10//! (header, timestamp deltas, UUID dictionary compression, blake3 trailer,
11//! expungement markers) knows nothing about any particular op. Each data
12//! domain implements [`Op`] for its own op type — for example the table op
13//! vocabulary in `ubiquisync-tables`.
14
15mod consts;
16mod decoder;
17mod encoder;
18mod error;
19mod op;
20mod reader;
21mod writer;
22
23pub use consts::{FLAG_DEVICE, FLAG_SERVER, TAG_EXPUNGED};
24pub use decoder::{DecodedEntry, DecodedLogs, Decoder};
25pub use encoder::Encoder;
26pub use error::CodecError;
27pub use op::{IndexableOp, Op, OpIndexEntry};
28pub use reader::{EntryBufferReader, Reader};
29pub use writer::EntryBufferWriter;