Enum mt_dom::patch::PatchType

source ·
pub enum PatchType<'a, Ns, Tag, Leaf, Att, Val>
where Ns: PartialEq + Clone + Debug, Tag: PartialEq + Debug, Leaf: PartialEq + Clone + Debug, Att: PartialEq + Clone + Debug, Val: PartialEq + Clone + Debug,
{ InsertBeforeNode { nodes: Vec<&'a Node<Ns, Tag, Leaf, Att, Val>>, }, InsertAfterNode { nodes: Vec<&'a Node<Ns, Tag, Leaf, Att, Val>>, }, AppendChildren { children: Vec<&'a Node<Ns, Tag, Leaf, Att, Val>>, }, RemoveNode, MoveBeforeNode { nodes_path: Vec<TreePath>, }, MoveAfterNode { nodes_path: Vec<TreePath>, }, ReplaceNode { replacement: Vec<&'a Node<Ns, Tag, Leaf, Att, Val>>, }, AddAttributes { attrs: Vec<&'a Attribute<Ns, Att, Val>>, }, RemoveAttributes { attrs: Vec<&'a Attribute<Ns, Att, Val>>, }, }
Expand description

the patch variant

Variants§

§

InsertBeforeNode

Fields

§nodes: Vec<&'a Node<Ns, Tag, Leaf, Att, Val>>

the nodes to be inserted before patch_path

insert the nodes before the node at patch_path

§

InsertAfterNode

Fields

§nodes: Vec<&'a Node<Ns, Tag, Leaf, Att, Val>>

the nodes to be inserted after the patch_path

insert the nodes after the node at patch_path

§

AppendChildren

Fields

§children: Vec<&'a Node<Ns, Tag, Leaf, Att, Val>>

children nodes to be appended and their corresponding new_node_idx

Append a vector of child nodes to a parent node id at patch_path

§

RemoveNode

remove the target node

§

MoveBeforeNode

Fields

§nodes_path: Vec<TreePath>

before this target location

remove the nodes pointed at these nodes_path and move them before target_element pointed at patch_path

§

MoveAfterNode

Fields

§nodes_path: Vec<TreePath>

after this target location

remove the the nodes pointed at these nodes_path and move them after the target_element pointed at patch_path

§

ReplaceNode

Fields

§replacement: Vec<&'a Node<Ns, Tag, Leaf, Att, Val>>

the node that will replace the target node

ReplaceNode a node with another node. This typically happens when a node’s tag changes. ex:

becomes

§

AddAttributes

Fields

§attrs: Vec<&'a Attribute<Ns, Att, Val>>

the attributes to be patched into the target node

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

Fields

§attrs: Vec<&'a Attribute<Ns, Att, Val>>

attributes that are to be removed from this target node

Remove attributes that the old node had that the new node doesn’t

Trait Implementations§

source§

impl<'a, Ns, Tag, Leaf, Att, Val> Clone for PatchType<'a, Ns, Tag, Leaf, Att, Val>
where Ns: PartialEq + Clone + Debug + Clone, Tag: PartialEq + Debug + Clone, Leaf: PartialEq + Clone + Debug + Clone, Att: PartialEq + Clone + Debug + Clone, Val: PartialEq + Clone + Debug + Clone,

source§

fn clone(&self) -> PatchType<'a, Ns, Tag, Leaf, Att, Val>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'a, Ns, Tag, Leaf, Att, Val> Debug for PatchType<'a, Ns, Tag, Leaf, Att, Val>
where Ns: PartialEq + Clone + Debug + Debug, Tag: PartialEq + Debug + Debug, Leaf: PartialEq + Clone + Debug + Debug, Att: PartialEq + Clone + Debug + Debug, Val: PartialEq + Clone + Debug + Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a, Ns, Tag, Leaf, Att, Val> PartialEq for PatchType<'a, Ns, Tag, Leaf, Att, Val>

source§

fn eq(&self, other: &PatchType<'a, Ns, Tag, Leaf, Att, Val>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<'a, Ns, Tag, Leaf, Att, Val> StructuralPartialEq for PatchType<'a, Ns, Tag, Leaf, Att, Val>
where Ns: PartialEq + Clone + Debug, Tag: PartialEq + Debug, Leaf: PartialEq + Clone + Debug, Att: PartialEq + Clone + Debug, Val: PartialEq + Clone + Debug,

Auto Trait Implementations§

§

impl<'a, Ns, Tag, Leaf, Att, Val> RefUnwindSafe for PatchType<'a, Ns, Tag, Leaf, Att, Val>

§

impl<'a, Ns, Tag, Leaf, Att, Val> Send for PatchType<'a, Ns, Tag, Leaf, Att, Val>
where Att: Sync, Leaf: Sync, Ns: Sync, Tag: Sync, Val: Sync,

§

impl<'a, Ns, Tag, Leaf, Att, Val> Sync for PatchType<'a, Ns, Tag, Leaf, Att, Val>
where Att: Sync, Leaf: Sync, Ns: Sync, Tag: Sync, Val: Sync,

§

impl<'a, Ns, Tag, Leaf, Att, Val> Unpin for PatchType<'a, Ns, Tag, Leaf, Att, Val>

§

impl<'a, Ns, Tag, Leaf, Att, Val> UnwindSafe for PatchType<'a, Ns, Tag, Leaf, Att, Val>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.