pub struct TreeState {
pub selected: usize,
pub expanded: HashSet<String>,
pub offset: usize,
pub visible_count: usize,
}Expand description
State for the tree widget.
Fields§
§selected: usizeCurrently selected node index in flattened view
expanded: HashSet<String>Set of expanded node IDs
offset: usizeScroll offset
visible_count: usizeTotal visible items
Implementations§
Source§impl TreeState
impl TreeState
pub fn new() -> Self
pub fn toggle_expand(&mut self, node_id: &str)
pub fn expand(&mut self, node_id: &str)
pub fn collapse(&mut self, node_id: &str)
pub fn is_expanded(&self, node_id: &str) -> bool
pub fn select_next(&mut self)
pub fn select_prev(&mut self)
pub fn select_first(&mut self)
pub fn select_last(&mut self)
pub fn page_down(&mut self, page_size: usize)
pub fn page_up(&mut self, page_size: usize)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TreeState
impl RefUnwindSafe for TreeState
impl Send for TreeState
impl Sync for TreeState
impl Unpin for TreeState
impl UnsafeUnpin for TreeState
impl UnwindSafe for TreeState
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<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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