pub enum MutationEvent {
NodeInserted {
label: String,
key: String,
},
PropSet {
key: String,
field: String,
},
PropRemoved {
key: String,
field: String,
},
EdgeInserted {
edge_type: String,
src: String,
dst: String,
},
EdgeDeleted {
edge_type: String,
src: String,
dst: String,
},
NodeDeleted {
key: String,
},
RuleCreated {
name: String,
},
RuleDeleted {
name: String,
},
RuleRebuilt {
name: String,
},
BatchApplied {
ops: usize,
},
Ingested {
label: String,
inserted: usize,
},
}Expand description
A post-commit mutation notification.
Emitted from log_then_apply after the WAL append, fsync, and
in-memory apply all succeed. Never emitted for rejected operations
(validation errors, GraphError::RuleOwned, duplicate keys, no-op
deletes/removes). Event payloads carry user keys and rule names, never
internal ids.
Replay: GraphDb::open / GraphDb::open_with replay the WAL via
apply only. Emission lives exclusively in log_then_apply, so
recovery is silent even if a sink were installed (it cannot be: the
sink is in-memory and set after open).
Ordering: a Batch WAL frame emits one event per inner record, then
MutationEvent::BatchApplied. An ingest commit emits those same inner
events, then MutationEvent::Ingested (not BatchApplied). An empty
or all-noop batch writes no WAL and emits nothing (including no summary).
Derived edges: rule-created or retracted edges are not individually evented — they are recoverable from the triggering mutation plus the live rule set. Only the triggering record is emitted.
Wire form: externally tagged snake_case JSON
({"node_inserted":{"label":"A","key":"k"}}).
Variants§
NodeInserted
PropSet
PropRemoved
EdgeInserted
EdgeDeleted
NodeDeleted
RuleCreated
RuleDeleted
RuleRebuilt
BatchApplied
Ingested
Trait Implementations§
Source§impl Clone for MutationEvent
impl Clone for MutationEvent
Source§fn clone(&self) -> MutationEvent
fn clone(&self) -> MutationEvent
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more