pub enum TreeChange {
NodeInserted {
parent: Option<NodeId>,
index: usize,
node: NodeId,
},
NodeRemoved {
parent: Option<NodeId>,
node: NodeId,
},
NodeMoved {
node: NodeId,
old_parent: Option<NodeId>,
new_parent: Option<NodeId>,
new_index: usize,
},
NodeUpdated {
node: NodeId,
},
Reset,
}Expand description
Describes a mutation to a tree structure. Emitted by TreeModel<T> automatically.
Variants§
NodeInserted
A node was inserted as a child of parent at the given index.
parent is None for root-level insertions.
NodeRemoved
A node (and its entire subtree) was removed.
parent is None if it was a root-level node.
NodeMoved
A node was moved to a new parent at the given index.
NodeUpdated
A node’s data was updated in place.
Reset
The entire tree was replaced. Consumers should discard all state and rebuild.
Trait Implementations§
Source§impl Clone for TreeChange
impl Clone for TreeChange
Source§fn clone(&self) -> TreeChange
fn clone(&self) -> TreeChange
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TreeChange
impl Debug for TreeChange
impl Eq for TreeChange
Source§impl PartialEq for TreeChange
impl PartialEq for TreeChange
Source§fn eq(&self, other: &TreeChange) -> bool
fn eq(&self, other: &TreeChange) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for TreeChange
Auto Trait Implementations§
impl Freeze for TreeChange
impl RefUnwindSafe for TreeChange
impl Send for TreeChange
impl Sync for TreeChange
impl Unpin for TreeChange
impl UnsafeUnpin for TreeChange
impl UnwindSafe for TreeChange
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