pub struct TransactionEvent<'a> {
pub hlc: HlcTimestamp,
pub node_id: &'a str,
pub table: &'a TableId,
pub op: &'a WriteOp,
pub before: Option<&'a [u8]>,
pub prev_hlc: Option<HlcTimestamp>,
}Expand description
A single committed transaction event — what observers see.
Borrowed view: the backend produces this on the stack at commit time and passes it by reference. Observers that want to outlive the borrow must copy the fields they care about.
Fields§
§hlc: HlcTimestampHLC timestamp assigned to this write at commit time.
node_id: &'a strNode identifier of the writer.
For locally-originated writes, this is self.node_id — the
id of the node that called write_batch. For writes applied
by the replication observer in response to a peer’s log
entry, this is the originating peer’s id, not the local
node’s. Observers that should only act on local writes
(e.g., the replication observer’s outgoing-log writer) filter
on node_id == self.node_id; observers that act on all
observed state (e.g., audit) do not filter.
table: &'a TableIdIn-deployment table identity (app / database / table). Tenant
scoping lives at the deployment frame in the multiplexer, not
inside the table id — see crate::types::DeploymentHash.
op: &'a WriteOpThe write operation. Put or Delete; CRDT operations are
encoded inside the value via __op__ markers (per the
Harper convention). The wire shape stays uniform; CRDT-ness
is in the data, not the protocol.
before: Option<&'a [u8]>Existing value bytes at the key (if any) prior to this write,
populated only if some registered observer set
ObserverRequirements::needs_before_value.
prev_hlc: Option<HlcTimestamp>HLC of the existing record at the key (if any), populated
only if some registered observer set
ObserverRequirements::needs_prev_hlc. Used by replication
to record causal-predecessor relationships in the log.