pub struct LogEntry<E> {
pub server_user_id: Option<Uuid>,
pub timestamp: Timestamp,
pub op: E,
}Expand description
A single log entry: one operation plus metadata. This is the unit written to and read from segment files — each entry has its own blake3 hash and can be independently expunged.
The entry is generic over its op vocabulary E: each data domain defines
its own op type and carries it in this envelope — for example the table
op vocabulary in ubiquisync-tables. Any domains in use share one HLC
clock domain, so timestamps are causally comparable across them.
Fields§
§server_user_id: Option<Uuid>The server-attested user id for this entry. Every entry originates
from some user, but this field specifically carries the identity a
server vouched for — it is populated only in server-mode segments, where
the server asserts attribution. None in device mode, where attribution
is implicit from the peer directory and no server assertion exists.
Do not read this as “the author”; read it as “who the server said this
was.” It is distinct from a stream’s peer_id (which stream the entry
came from).
timestamp: TimestampHLC timestamp — monotonically non-decreasing within a peer’s stream. Entries written in one atomic transaction share a tick, so they are treated as one logical write by LWW comparisons.
op: EThe state mutation.