pub struct TreeState { /* private fields */ }Expand description
Behavior and interaction state for a virtualized tree.
Implementations§
Source§impl TreeState
impl TreeState
pub fn new(cx: &mut App) -> Self
pub fn items(self, items: impl Into<Vec<TreeItem>>) -> Self
pub fn set_items( &mut self, items: impl Into<Vec<TreeItem>>, cx: &mut Context<'_, Self>, )
pub fn selected_index(&self) -> Option<usize>
pub fn set_selected_index( &mut self, ix: Option<usize>, cx: &mut Context<'_, Self>, )
pub fn set_selected_item( &mut self, item: Option<&TreeItem>, cx: &mut Context<'_, Self>, )
pub fn selected_item(&self) -> Option<&TreeItem>
pub fn selected_entry(&self) -> Option<&TreeEntry>
pub fn entry(&self, ix: usize) -> Option<&TreeEntry>
pub fn scroll_handle(&self) -> &UniformListScrollHandle
pub fn scroll_to_item(&mut self, ix: usize, strategy: ScrollStrategy)
pub fn index_of(&self, id: &SharedString) -> Option<usize>
pub fn reveal_item( &mut self, id: &SharedString, strategy: ScrollStrategy, cx: &mut Context<'_, Self>, )
pub fn focus(&mut self, window: &mut Window, cx: &mut App)
Trait Implementations§
impl EventEmitter<TreeEvent> for TreeState
Auto Trait Implementations§
impl !RefUnwindSafe for TreeState
impl !Send for TreeState
impl !Sync for TreeState
impl !UnwindSafe for TreeState
impl Freeze for TreeState
impl Unpin for TreeState
impl UnsafeUnpin 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> 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