Skip to main content

TransactionEvent

Struct TransactionEvent 

Source
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: HlcTimestamp

HLC timestamp assigned to this write at commit time.

§node_id: &'a str

Node 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 TableId

In-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 WriteOp

The 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.

Trait Implementations§

Source§

impl<'a> Debug for TransactionEvent<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for TransactionEvent<'a>

§

impl<'a> RefUnwindSafe for TransactionEvent<'a>

§

impl<'a> Send for TransactionEvent<'a>

§

impl<'a> Sync for TransactionEvent<'a>

§

impl<'a> Unpin for TransactionEvent<'a>

§

impl<'a> UnsafeUnpin for TransactionEvent<'a>

§

impl<'a> UnwindSafe for TransactionEvent<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more