#[repr(C)]pub struct TreeViewNode {
pub label: AzString,
pub children: TreeViewNodeVec,
pub is_expanded: bool,
pub is_selected: bool,
}Expand description
A single node in a tree hierarchy, with optional children.
Fields§
§label: AzStringDisplay text for this node.
children: TreeViewNodeVecChild nodes nested under this node.
is_expanded: boolWhether children are visible (only meaningful when children is non-empty).
is_selected: boolWhether this node is visually selected.
Implementations§
Source§impl TreeViewNode
impl TreeViewNode
Sourcepub fn new<S: Into<AzString>>(label: S) -> Self
pub fn new<S: Into<AzString>>(label: S) -> Self
Creates a new collapsed, unselected leaf node with the given label.
Sourcepub fn add_child(&mut self, child: TreeViewNode)
pub fn add_child(&mut self, child: TreeViewNode)
Appends a child node.
Sourcepub fn with_child(self, child: TreeViewNode) -> Self
pub fn with_child(self, child: TreeViewNode) -> Self
Builder method: appends a child node.
Sourcepub fn with_expanded(self, expanded: bool) -> Self
pub fn with_expanded(self, expanded: bool) -> Self
Builder method: sets the expanded state.
Sourcepub fn with_selected(self, selected: bool) -> Self
pub fn with_selected(self, selected: bool) -> Self
Builder method: sets the selected state.
Trait Implementations§
Source§impl Clone for TreeViewNode
impl Clone for TreeViewNode
Source§fn clone(&self) -> TreeViewNode
fn clone(&self) -> TreeViewNode
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TreeViewNode
impl Debug for TreeViewNode
Source§impl Extend<TreeViewNode> for TreeViewNodeVec
impl Extend<TreeViewNode> for TreeViewNodeVec
Source§fn extend<T: IntoIterator<Item = TreeViewNode>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = TreeViewNode>>(&mut self, iter: T)
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one)Reserves capacity in a collection for the given number of additional elements. Read more
Source§impl FromIterator<TreeViewNode> for TreeViewNodeVec
impl FromIterator<TreeViewNode> for TreeViewNodeVec
Source§fn from_iter<T>(iter: T) -> Selfwhere
T: IntoIterator<Item = TreeViewNode>,
fn from_iter<T>(iter: T) -> Selfwhere
T: IntoIterator<Item = TreeViewNode>,
Creates a value from an iterator. Read more
Source§impl PartialEq for TreeViewNode
impl PartialEq for TreeViewNode
Source§fn eq(&self, other: &TreeViewNode) -> bool
fn eq(&self, other: &TreeViewNode) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for TreeViewNode
Auto Trait Implementations§
impl Freeze for TreeViewNode
impl RefUnwindSafe for TreeViewNode
impl Send for TreeViewNode
impl Sync for TreeViewNode
impl Unpin for TreeViewNode
impl UnsafeUnpin for TreeViewNode
impl UnwindSafe for TreeViewNode
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