pub enum PatchOp {
Insert {
dest: RankedDest,
node: PatchNode,
},
Put {
slot: SlotRef,
node: PatchNode,
},
Replace {
target_id: NodeId,
replacement: PatchNode,
},
Delete {
target_id: NodeId,
},
Move {
target_id: NodeId,
dest: PatchDest,
},
Set {
path: PatchPath,
value: PatchValue,
},
Clear {
path: PatchPath,
},
Attach {
node_id: NodeId,
target_id: NodeId,
},
Detach {
node_id: NodeId,
},
}Expand description
Structured patch operation over the Draxl semantic model.
Variants§
Insert
Inserts a new child into a ranked slot.
Fields
§
dest: RankedDestRanked destination that owns the inserted child.
Put
Fills or replaces a single-child slot.
Replace
Rewrites an existing node payload while preserving its outer shell.
Fields
Delete
Removes an existing node.
Move
Relocates an existing node while preserving its identity.
Fields
Set
Updates a scalar field or metadata path.
Clear
Clears an optional scalar field or metadata path.
Attach
Attaches a doc or comment node to a semantic target.
Detach
Detaches a doc or comment node.
Trait Implementations§
impl Eq for PatchOp
impl StructuralPartialEq for PatchOp
Auto Trait Implementations§
impl Freeze for PatchOp
impl RefUnwindSafe for PatchOp
impl Send for PatchOp
impl Sync for PatchOp
impl Unpin for PatchOp
impl UnsafeUnpin for PatchOp
impl UnwindSafe for PatchOp
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