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<K> Node<StateId<K>, K::State>
impl<K> Node<StateId<K>, K::State>
pub fn new(id: StateId<K>) -> Self
pub const fn zipper(self) -> Zipper<StateId<K>, K::State>
pub fn get(&self, id: StateId<K>) -> Option<&Self>
pub fn get_state(&self, id: StateId<K>) -> Option<&K::State>
pub fn child(&self, id: StateId<K>) -> Option<&Self>
pub fn child_idx(&self, id: StateId<K>) -> Option<usize>
pub fn insert(&mut self, insert: Insert<StateId<K>>)
Sourcepub fn into_insert(self, _: Insert<StateId<K>>) -> Self
pub fn into_insert(self, _: Insert<StateId<K>>) -> Self
inserts a new node using self by value
pub fn get_parent_id(&self, id: StateId<K>) -> Option<StateId<K>>
pub fn update(&mut self, update: Update<StateId<K>, K::State>)
Sourcepub fn update_and_get_parent_id(
&mut self,
_: Update<StateId<K>, K::State>,
) -> Option<StateId<K>>
pub fn update_and_get_parent_id( &mut self, _: Update<StateId<K>, K::State>, ) -> Option<StateId<K>>
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<StateId<K>, K::State>) -> Self
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