pub struct TreeNode<T> {
pub value: T,
/* private fields */
}Expand description
A single tree node
Fields§
§value: TImplementations§
Source§impl<T> TreeNode<T>
impl<T> TreeNode<T>
Sourcepub fn clear_children(&mut self)
pub fn clear_children(&mut self)
Remove all children of this node
Sourcepub fn insert_child_at(parent: &NodeRef<T>, index: usize, child: NodeRef<T>)
pub fn insert_child_at(parent: &NodeRef<T>, index: usize, child: NodeRef<T>)
Insert a child at a given position
Sourcepub fn add_child_value(parent: &NodeRef<T>, value: T) -> NodeRef<T>
pub fn add_child_value(parent: &NodeRef<T>, value: T) -> NodeRef<T>
Create a child with value and add it to parent
Sourcepub fn replace_child(
parent: &NodeRef<T>,
index: usize,
new_child: NodeRef<T>,
) -> Option<NodeRef<T>>
pub fn replace_child( parent: &NodeRef<T>, index: usize, new_child: NodeRef<T>, ) -> Option<NodeRef<T>>
Replace child at given index
Sourcepub fn find_children_by<F>(&self, predicate: F) -> Vec<NodeRef<T>> ⓘ
pub fn find_children_by<F>(&self, predicate: F) -> Vec<NodeRef<T>> ⓘ
Find direct children matching predicate
Sourcepub fn clone_node(&self, deep: bool) -> NodeRef<T>where
T: Clone,
pub fn clone_node(&self, deep: bool) -> NodeRef<T>where
T: Clone,
Clone node (optionally deep)
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for TreeNode<T>where
T: Freeze,
impl<T> !RefUnwindSafe for TreeNode<T>
impl<T> !Send for TreeNode<T>
impl<T> !Sync for TreeNode<T>
impl<T> Unpin for TreeNode<T>where
T: Unpin,
impl<T> !UnwindSafe for TreeNode<T>
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,
§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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