enum
Patch
pub enum Patch {
Replace { path: Vec<usize>, node: VNode },
SetText { path: Vec<usize>, text: String },
SetAttr { path: Vec<usize>, name: String, value: Value },
RemoveAttr { path: Vec<usize>, name: String },
SetEvents { path: Vec<usize>, events: Vec<EventHandler> },
Append { path: Vec<usize>, node: VNode },
Truncate { path: Vec<usize>, len: usize },
}A single change. Paths index from the root list; Append/Truncate paths name the parent (empty = root list).
Variants
SetAttr
SetAttr { path: Vec<usize>, name: String, value: Value }Set an attribute on the element at path.
RemoveAttr
RemoveAttr { path: Vec<usize>, name: String }Remove an attribute from the element at path.
SetEvents
SetEvents { path: Vec<usize>, events: Vec<EventHandler> }Replace the event handlers of the element at path.
Methods
path
pub fn path(&self) -> &[usize]The position in the tree the patch applies to: child indexes from the root.