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 owner_document(&self) -> Option<u64>
pub fn owner_document(&self) -> Option<u64>
The DOM id of the document that created this node, if known.
Sourcepub fn set_owner_document(&self, document_dom_id: u64)
pub fn set_owner_document(&self, document_dom_id: u64)
Records the DOM id of the document that owns this node.
Sourcepub fn form_state(&self) -> FormState
pub fn form_state(&self) -> FormState
The node’s live form-control state.
Sourcepub fn set_form_state(&self, state: FormState)
pub fn set_form_state(&self, state: FormState)
Replaces the node’s live form-control state.
Sourcepub fn checkedness(&self) -> Option<bool>
pub fn checkedness(&self) -> Option<bool>
The live checkedness, if the script has set one explicitly.
Sourcepub fn set_checkedness(&self, checked: bool)
pub fn set_checkedness(&self, checked: bool)
Sets the live checkedness, leaving the checked attribute alone.
Sourcepub fn clear_children(&mut self)
pub fn clear_children(&mut self)
Remove all children of this node
Sourcepub fn remove_child(
parent: &NodeRef<T>,
child: &NodeRef<T>,
) -> Option<NodeRef<T>>
pub fn remove_child( parent: &NodeRef<T>, child: &NodeRef<T>, ) -> Option<NodeRef<T>>
Removes child from parent, returning the detached node when found.
Sourcepub fn append_child(parent: &NodeRef<T>, child: NodeRef<T>) -> bool
pub fn append_child(parent: &NodeRef<T>, child: NodeRef<T>) -> bool
Appends child, moving it from its current parent when necessary.
Returns false when the operation would create a tree cycle.
Sourcepub fn insert_before(
parent: &NodeRef<T>,
child: NodeRef<T>,
reference: &NodeRef<T>,
) -> bool
pub fn insert_before( parent: &NodeRef<T>, child: NodeRef<T>, reference: &NodeRef<T>, ) -> bool
Inserts child immediately before reference, moving it from its
current parent when necessary.
pub fn is_inclusive_ancestor(ancestor: &NodeRef<T>, node: &NodeRef<T>) -> bool
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>
impl<T> !RefUnwindSafe for TreeNode<T>
impl<T> !Send for TreeNode<T>
impl<T> !Sync for TreeNode<T>
impl<T> !UnwindSafe for TreeNode<T>
impl<T> Unpin for TreeNode<T>where
T: Unpin,
impl<T> UnsafeUnpin for TreeNode<T>where
T: UnsafeUnpin,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
§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> ⓘ
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> ⓘ
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> ⓘ
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