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.
Sourcepub fn icon(self, key: impl Into<String>, color: Option<&str>) -> Self
pub fn icon(self, key: impl Into<String>, color: Option<&str>) -> Self
Icon key drawn before the label, optionally in theme colour color.
Sourcepub fn meter(self, fraction: f32, tone: impl Into<String>) -> Self
pub fn meter(self, fraction: f32, tone: impl Into<String>) -> Self
A small block meter at the right of the row, left of the detail,
filled to fraction (0 to 1) in theme colour tone, such as the progress towards a goal.
A faint row draws it faint too. A row too narrow for its label and the meter drops the
meter first, so the name is never cut for it; in the ASCII glyph mode it fills whole
cells.
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
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
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> ⓘ
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