pub enum Change {
Show 13 variants
NodeCreated {
id: NodeId,
labels: LabelSet,
properties: PropertyMap,
},
NodeUpdated {
id: NodeId,
labels_diff: LabelDiff,
properties_diff: PropertyDiff,
},
NodeDeleted {
id: NodeId,
},
EdgeCreated {
id: EdgeId,
label: DbString,
source: NodeId,
target: NodeId,
properties: PropertyMap,
},
EdgeUpdated {
id: EdgeId,
properties_diff: PropertyDiff,
},
EdgeDeleted {
id: EdgeId,
},
SchemaChanged {
graph: GraphId,
change: SchemaChange,
},
NodePropertyRemoved {
id: NodeId,
property: DbString,
},
EdgePropertyRemoved {
id: EdgeId,
property: DbString,
},
NodeLabelRemoved {
id: NodeId,
label: DbString,
},
NodesOfTypeTruncated {
label: DbString,
},
EdgesOfTypeTruncated {
label: DbString,
},
GraphReset {},
}Expand description
A graph or schema change carried by the WAL.
Variants§
NodeCreated
Node creation.
Fields
properties: PropertyMapInitial properties.
NodeUpdated
Node update.
Fields
properties_diff: PropertyDiffProperty changes.
NodeDeleted
Node deletion.
EdgeCreated
Edge creation.
Fields
properties: PropertyMapInitial properties.
EdgeUpdated
Edge update.
EdgeDeleted
Edge deletion.
SchemaChanged
Schema mutation.
Fields
change: SchemaChangeSchema change payload.
NodePropertyRemoved
Node property removal.
EdgePropertyRemoved
Edge property removal.
NodeLabelRemoved
Node label removal.
NodesOfTypeTruncated
Bulk removal of every node carrying label plus all incident edges.
This is the O(1)-WAL declarative truncate change (BRIEF-150, deletion-
reclamation audit Item 11). It carries only the label — never the
affected node/edge ids — so a TRUNCATE NODE TYPE :L of N nodes still
writes exactly one WAL change. Recovery re-derives the affected rows by
walking the recovered store (“replay walks store”), marking dead every
alive node with label and every alive edge incident to such a node, so
the recovered state is byte-identical to MATCH (n:L) DETACH DELETE n.
Live commit fan-out substitutes the change with staged per-row
NodeDeleted/EdgeDeleted tombstones when the mutator captured them
during execution. WAL/recovery replay carries this persisted declarative
variant, so provider-owned derived state must either handle it directly
or rebuild from the recovered graph snapshot before serving reads.
EdgesOfTypeTruncated
Bulk removal of every edge carrying label.
The edge-type counterpart to Change::NodesOfTypeTruncated
(TRUNCATE EDGE TYPE :L). Carries only the label (O(1) WAL); recovery
re-derives the affected edges from the recovered store. Live commit
fan-out substitutes the change with staged per-row EdgeDeleted
tombstones when execution captured them; WAL/recovery replay carries
this persisted declarative variant, so providers must handle it directly
or rebuild before serving reads.
GraphReset
Factory-reset of the entire graph: wipe all nodes and edges (every
label, including untyped/arbitrary-label rows) and reset the schema
to open (bound_type -> None), in one declarative O(1)-WAL change.
This is the DROP GRAPH factory-reset change (BRIEF-152, deletion-
reclamation audit Item 10). Under D1 single-graph it targets the one
bound graph. It carries nothing — never the affected node/edge ids
nor any schema payload — so a reset of a graph with N rows still writes
exactly one WAL change. Recovery re-derives every affected row by walking
the recovered store (“replay walks store”), marking dead every alive node
and edge, and forces the recovered bound_type to None, so the
recovered state is byte-identical to MATCH (n) DETACH DELETE n followed
by a full schema drop. Live commit fan-out substitutes the change with
staged per-row NodeDeleted/EdgeDeleted tombstones when execution
captured them. WAL/recovery replay carries this persisted declarative
variant, so providers must handle it directly or rebuild before serving
reads. The MANIFEST epoch and WAL archive lineage are untouched: a
factory-reset is one committed WAL entry on top of the existing snapshot,
not a file-level wipe.
Implementations§
Source§impl Change
impl Change
Sourcepub const fn kind(&self) -> ChangeKind
pub const fn kind(&self) -> ChangeKind
Return the compact kind discriminant for this change.
Source§impl Change
impl Change
Sourcepub const ALL: &[fn() -> Self]
pub const ALL: &[fn() -> Self]
Factory table with one sample change for each Change variant.
Tests use this as an append-only ANCHOR so new WAL variants require a
source-of-truth census update in selene-core.
Sourcepub const VARIANT_COUNT: usize
pub const VARIANT_COUNT: usize
Number of known Change variants in this build.
Sourcepub fn variant_name(&self) -> &'static str
pub fn variant_name(&self) -> &'static str
Stable telemetry name for this change variant.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Change
impl<'de> Deserialize<'de> for Change
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl StructuralPartialEq for Change
Auto Trait Implementations§
impl Freeze for Change
impl RefUnwindSafe for Change
impl Send for Change
impl Sync for Change
impl Unpin for Change
impl UnsafeUnpin for Change
impl UnwindSafe for Change
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.