pub enum PatchType<'a, MSG> {
InsertBeforeNode {
nodes: Vec<Cow<'a, Node<MSG>>>,
},
InsertAfterNode {
nodes: Vec<&'a Node<MSG>>,
},
AppendChildren {
children: Vec<&'a Node<MSG>>,
},
ClearChildren,
RemoveNode,
MoveBeforeNode {
nodes_path: Vec<TreePath>,
},
MoveAfterNode {
nodes_path: Vec<TreePath>,
},
ReplaceNode {
replacement: Vec<&'a Node<MSG>>,
},
AddAttributes {
attrs: Vec<&'a Attribute<MSG>>,
},
RemoveAttributes {
attrs: Vec<&'a Attribute<MSG>>,
},
}
Expand description
the patch variant
Variants§
InsertBeforeNode
insert the nodes before the node at patch_path
InsertAfterNode
insert the nodes after the node at patch_path
AppendChildren
Append a vector of child nodes to a parent node id at patch_path
Fields
ClearChildren
clear the chilren of this node,
RemoveNode
remove the target node
MoveBeforeNode
remove the nodes pointed at these nodes_path
and move them before target_element
pointed at patch_path
MoveAfterNode
remove the the nodes pointed at these nodes_path
and move them after the target_element
pointed at patch_path
ReplaceNode
ReplaceNode a node with another node. This typically happens when a node’s tag changes. ex:
AddAttributes
Add attributes that the new node has that the old node does not Note: the attributes is not a reference since attributes of same name are merged to produce a new unify attribute
RemoveAttributes
Remove attributes that the old node had that the new node doesn’t
Implementations§
Trait Implementations§
source§impl<'a, MSG> PartialEq for PatchType<'a, MSG>
impl<'a, MSG> PartialEq for PatchType<'a, MSG>
impl<'a, MSG> Eq for PatchType<'a, MSG>
Auto Trait Implementations§
impl<'a, MSG> Freeze for PatchType<'a, MSG>
impl<'a, MSG> !RefUnwindSafe for PatchType<'a, MSG>
impl<'a, MSG> !Send for PatchType<'a, MSG>
impl<'a, MSG> !Sync for PatchType<'a, MSG>
impl<'a, MSG> Unpin for PatchType<'a, MSG>
impl<'a, MSG> !UnwindSafe for PatchType<'a, MSG>
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
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.