pub struct TreeNode { /* private fields */ }Expand description
One node of a Tree, identified by a key that stays the same while the tree changes.
Implementations§
Source§impl TreeNode
impl TreeNode
Sourcepub fn new(key: impl Into<String>, label: impl Into<String>) -> Self
pub fn new(key: impl Into<String>, label: impl Into<String>) -> Self
A leaf named label, identified by key.
Sourcepub fn children(self, children: impl IntoIterator<Item = Self>) -> Self
pub fn children(self, children: impl IntoIterator<Item = Self>) -> Self
Child nodes; a node with children can be opened.
Sourcepub fn expandable(self, expandable: bool) -> Self
pub fn expandable(self, expandable: bool) -> Self
Marks a node as openable before its children are known, for children loaded when it
opens. Opening it sends Tree::on_expand; supply the children in a later frame.
Sourcepub fn loading(self, loading: bool) -> Self
pub fn loading(self, loading: bool) -> Self
Marks the node’s children as being loaded. A load that takes longer than about 300 ms shows a spinner in place of the chevron, which then stays at least about 500 ms; quicker loads keep the chevron, so they never flash a spinner.
Trait Implementations§
impl Eq for TreeNode
impl StructuralPartialEq for TreeNode
Auto Trait Implementations§
impl Freeze for TreeNode
impl RefUnwindSafe for TreeNode
impl Send for TreeNode
impl Sync for TreeNode
impl Unpin for TreeNode
impl UnsafeUnpin for TreeNode
impl UnwindSafe for TreeNode
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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