pub struct TreeNode<V> { /* private fields */ }
Expand description
A node in the SMT, consisting of the links to its parent, child nodes, value and node type.
Implementations§
Source§impl<V: Clone + Default + Mergeable + Paddable> TreeNode<V>
impl<V: Clone + Default + Mergeable + Paddable> TreeNode<V>
Sourcepub fn get_lch(&self) -> Option<usize>
pub fn get_lch(&self) -> Option<usize>
Returns the reference to the left child of the tree node.
If the child node doesn’t exist, return None
.
Sourcepub fn get_rch(&self) -> Option<usize>
pub fn get_rch(&self) -> Option<usize>
Returns the reference to the right child of the tree node.
If the child node doesn’t exist, return None
.
Sourcepub fn get_child_by_dir(&self, dir: ChildDir) -> Option<usize>
pub fn get_child_by_dir(&self, dir: ChildDir) -> Option<usize>
Returns the reference to the child in the input direction of the tree node.
If the child node doesn’t exist, return None
.
Sourcepub fn get_parent(&self) -> Option<usize>
pub fn get_parent(&self) -> Option<usize>
Returns the reference to the parent of the tree node.
If the parent node doesn’t exist, return None
.
Sourcepub fn get_node_type(&self) -> &NodeType
pub fn get_node_type(&self) -> &NodeType
Returns the node type.
Sourcepub fn set_parent(&mut self, idx: usize)
pub fn set_parent(&mut self, idx: usize)
Set the reference to the parent node as the input.
Sourcepub fn set_node_type(&mut self, x: NodeType)
pub fn set_node_type(&mut self, x: NodeType)
Set the tree node type as the input.
Trait Implementations§
Auto Trait Implementations§
impl<V> Freeze for TreeNode<V>where
V: Freeze,
impl<V> RefUnwindSafe for TreeNode<V>where
V: RefUnwindSafe,
impl<V> Send for TreeNode<V>where
V: Send,
impl<V> Sync for TreeNode<V>where
V: Sync,
impl<V> Unpin for TreeNode<V>where
V: Unpin,
impl<V> UnwindSafe for TreeNode<V>where
V: 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more