pub struct TreeNode<T> { /* private fields */ }Expand description
Application value and hierarchy retained by a TreeState.
Implementations§
Source§impl<T> TreeNode<T>
impl<T> TreeNode<T>
pub fn new( id: impl Into<ElementId>, label: impl Into<Arc<str>>, value: T, ) -> Self
Sourcepub fn pending(self, pending: bool) -> Self
pub fn pending(self, pending: bool) -> Self
Declare a branch whose children have not been loaded yet.
A pending node expands like any other branch. The first expansion mounts one placeholder
row and dispatches TreeLoadChildren; supplying children through
TreeState::set_children clears the pending flag. A node that already carries children
is an ordinary branch and ignores this flag.
pub const fn is_pending(&self) -> bool
pub fn child(self, child: TreeNode<T>) -> Self
pub fn children(self, children: impl IntoIterator<Item = TreeNode<T>>) -> Self
pub fn disabled(self, disabled: bool) -> Self
pub const fn id(&self) -> ElementId
pub fn label(&self) -> &Arc<str> ⓘ
pub fn value(&self) -> &T
pub fn child_nodes(&self) -> &[TreeNode<T>]
pub const fn is_disabled(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl<T> Forget for TreeNode<T>
impl<T> Freeze for TreeNode<T>
impl<T> Move for TreeNode<T>
impl<T> RefUnwindSafe for TreeNode<T>
impl<T> Send for TreeNode<T>
impl<T> Sync for TreeNode<T>
impl<T> Unpin for TreeNode<T>
impl<T> UnsafeUnpin for TreeNode<T>
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
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,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.