pub enum GraphOp {
DefineOntology {
ontology: Ontology,
},
AddNode {
node_id: String,
node_type: String,
subtype: Option<String>,
label: String,
properties: BTreeMap<String, Value>,
},
AddEdge {
edge_id: String,
edge_type: String,
source_id: String,
target_id: String,
properties: BTreeMap<String, Value>,
},
UpdateProperty {
entity_id: String,
key: String,
value: Value,
},
RemoveNode {
node_id: String,
},
RemoveEdge {
edge_id: String,
},
ExtendOntology {
extension: OntologyExtension,
},
Checkpoint {
ops: Vec<GraphOp>,
op_clocks: Vec<(u64, u32)>,
compacted_at_physical_ms: u64,
compacted_at_logical: u32,
},
}Expand description
Graph operations — the payload of each Merkle-DAG entry.
DefineOntology must be the first (genesis) entry. All subsequent
operations are validated against the ontology it defines.
Variants§
DefineOntology
Genesis entry — defines the initial ontology (extendable via R-03 ExtendOntology). Must be the first entry in the DAG (next = []).
AddNode
Fields
AddEdge
Fields
UpdateProperty
RemoveNode
RemoveEdge
ExtendOntology
R-03: Extend the ontology with new types/properties (monotonic only).
Fields
§
extension: OntologyExtensionCheckpoint
R-08: Checkpoint entry — summarizes all prior state. Contains synthetic ops that reconstruct the full graph when replayed. After compaction, this becomes the new genesis (next=[]).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for GraphOp
impl<'de> Deserialize<'de> for GraphOp
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>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for GraphOp
Auto Trait Implementations§
impl Freeze for GraphOp
impl RefUnwindSafe for GraphOp
impl Send for GraphOp
impl Sync for GraphOp
impl Unpin for GraphOp
impl UnsafeUnpin for GraphOp
impl UnwindSafe for GraphOp
Blanket Implementations§
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
Mutably borrows from an owned value. Read more