pub struct TreeViewProps<'a, Id, T, A>{
pub nodes: &'a [TreeNode<Id, T>],
pub selected_id: Option<&'a Id>,
pub expanded_ids: &'a HashSet<Id>,
pub is_focused: bool,
pub style: TreeViewStyle,
pub behavior: TreeViewBehavior,
pub measure_node: Option<&'a dyn Fn(&TreeNode<Id, T>) -> usize>,
pub column_padding: usize,
pub on_select: fn(&Id) -> A,
pub on_toggle: fn(&Id, bool) -> A,
pub render_node: &'a dyn Fn(TreeNodeRender<'_, Id, T>) -> Line<'static>,
}Expand description
Props for TreeView component
Fields§
§nodes: &'a [TreeNode<Id, T>]Nodes to render
selected_id: Option<&'a Id>Currently selected node id
expanded_ids: &'a HashSet<Id>Expanded node ids
is_focused: boolWhether this component has focus
style: TreeViewStyleUnified styling
behavior: TreeViewBehaviorBehavior configuration
measure_node: Option<&'a dyn Fn(&TreeNode<Id, T>) -> usize>Optional width override for column sizing
column_padding: usizePadding to add to the widest tree column
on_select: fn(&Id) -> ACallback to create action when selection changes
on_toggle: fn(&Id, bool) -> ACallback to create action when expansion changes
render_node: &'a dyn Fn(TreeNodeRender<'_, Id, T>) -> Line<'static>Render a node into a Line
Auto Trait Implementations§
impl<'a, Id, T, A> Freeze for TreeViewProps<'a, Id, T, A>
impl<'a, Id, T, A> !RefUnwindSafe for TreeViewProps<'a, Id, T, A>
impl<'a, Id, T, A> !Send for TreeViewProps<'a, Id, T, A>
impl<'a, Id, T, A> !Sync for TreeViewProps<'a, Id, T, A>
impl<'a, Id, T, A> Unpin for TreeViewProps<'a, Id, T, A>
impl<'a, Id, T, A> !UnwindSafe for TreeViewProps<'a, Id, T, A>
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> 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