pub struct Node<Id, S> {
pub id: Id,
pub state: S,
pub children: Vec<Node<Id, S>>,
/* private fields */
}Fields§
§id: Id§state: S§children: Vec<Node<Id, S>>Implementations§
source§impl<Id, S> Node<Id, S>
impl<Id, S> Node<Id, S>
pub fn new(id: Id) -> Self
pub fn zipper(self) -> Zipper<Id, S>
pub fn get(&self, id: Id) -> Option<&Node<Id, S>>
pub fn get_state(&self, id: Id) -> Option<&S>
pub fn child(&self, id: Id) -> Option<&Node<Id, S>>
pub fn child_idx(&self, id: Id) -> Option<usize>
pub fn insert(&mut self, insert: Insert<Id>)
sourcepub fn into_insert(self, _: Insert<Id>) -> Node<Id, S>
pub fn into_insert(self, _: Insert<Id>) -> Node<Id, S>
inserts a new node using self by value
pub fn get_parent_id(&self, id: Id) -> Option<Id>
pub fn update(&mut self, update: Update<Id, S>)
sourcepub fn update_and_get_parent_id(&mut self, _: Update<Id, S>) -> Option<Id>
pub fn update_and_get_parent_id(&mut self, _: Update<Id, S>) -> Option<Id>
update a given node’s state and return the parent ID if it exists
pub fn update_all_fn<F>(&mut self, f: F)
pub fn into_update(self, _: Update<Id, S>) -> Node<Id, S>
Trait Implementations§
Auto Trait Implementations§
impl<Id, S> Freeze for Node<Id, S>
impl<Id, S> RefUnwindSafe for Node<Id, S>where
Id: RefUnwindSafe,
S: RefUnwindSafe,
impl<Id, S> Send for Node<Id, S>
impl<Id, S> Sync for Node<Id, S>
impl<Id, S> Unpin for Node<Id, S>
impl<Id, S> UnwindSafe for Node<Id, S>where
Id: UnwindSafe,
S: UnwindSafe,
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