pub struct TreeViewNode {
pub id: String,
pub content: WidgetRef,
pub children: Vec<TreeViewNode>,
pub is_expanded: bool,
pub has_unrealized_children: bool,
}Expand description
XAML TreeViewNode: one node of the tree the application passes.
Fields§
§id: StringIdentity across rebuilds and moves; unique within the whole tree.
content: WidgetRefContent: what the node’s row shows.
children: Vec<TreeViewNode>Children, in order.
is_expanded: boolIsExpanded: whether the node’s children are rows of the list.
has_unrealized_children: boolHasUnrealizedChildren: the node has children the application has not passed yet, which
it loads in expanding. Such a node shows its chevron.
Implementations§
Source§impl TreeViewNode
impl TreeViewNode
Sourcepub fn new<K>(id: impl Into<String>, content: impl IntoWidget<K>) -> Self
pub fn new<K>(id: impl Into<String>, content: impl IntoWidget<K>) -> Self
Creates a node showing content, without children.
Sourcepub fn text(id: impl Into<String>, text: impl Into<String>) -> Self
pub fn text(id: impl Into<String>, text: impl Into<String>) -> Self
Creates a node that is text, as a node whose Content is a string shows it.
Sourcepub fn children(self, value: Vec<TreeViewNode>) -> Self
pub fn children(self, value: Vec<TreeViewNode>) -> Self
Sets Children.
Sourcepub fn is_expanded(self, value: bool) -> Self
pub fn is_expanded(self, value: bool) -> Self
Sets IsExpanded.
Sourcepub fn has_unrealized_children(self, value: bool) -> Self
pub fn has_unrealized_children(self, value: bool) -> Self
Sets HasUnrealizedChildren.
Trait Implementations§
Source§impl Clone for TreeViewNode
impl Clone for TreeViewNode
Auto Trait Implementations§
impl !RefUnwindSafe for TreeViewNode
impl !Send for TreeViewNode
impl !Sync for TreeViewNode
impl !UnwindSafe for TreeViewNode
impl Forget for TreeViewNode
impl Freeze for TreeViewNodewhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
*const RcInner<dyn Widget> is !null: Freeze,
PhantomData<RcInner<dyn Widget>>: Freeze,
PhantomData<TreeViewNode>: Freeze,
impl Move for TreeViewNode
impl Unpin for TreeViewNode
impl UnsafeUnpin for TreeViewNodewhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
*const RcInner<dyn Widget> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Widget>>: UnsafeUnpin,
PhantomData<TreeViewNode>: 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
Mutably borrows from an owned value. Read more