pub enum DeltaOp {
Add {
r: Ref,
parent: Ref,
pos: Option<u32>,
role: Role,
label: String,
ops: BTreeSet<Op>,
attrs: BTreeMap<String, String>,
},
Remove {
r: Ref,
},
Update {
r: Ref,
attrs: BTreeMap<String, String>,
},
Move {
r: Ref,
parent: Ref,
pos: Option<u32>,
},
Replace {
r: Ref,
subtree: Vec<Node>,
},
}Expand description
One delta operation.
Variants§
Add
Insert a new leaf node under parent at pos (or end if None).
parent == Ref::ROOT means root level.
Fields
Remove
Remove the subtree rooted at r.
Update
Replace the attribute map at r (per docs/codes.md, Update is
attribute-only; for role/label/ops changes use DeltaOp::Replace).
Move
Reparent or reorder r to parent at pos.
Replace
Blow away the subtree at r and install subtree in its place.
subtree[0].r == r; the wire-form indents these lines under
the *<ref> header.
Implementations§
Trait Implementations§
impl Eq for DeltaOp
impl StructuralPartialEq for DeltaOp
Auto Trait Implementations§
impl Freeze for DeltaOp
impl RefUnwindSafe for DeltaOp
impl Send for DeltaOp
impl Sync for DeltaOp
impl Unpin for DeltaOp
impl UnsafeUnpin for DeltaOp
impl UnwindSafe for DeltaOp
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