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
Source§impl Focusable for TreeState
impl Focusable for TreeState
Source§fn focus_handle(&self, _: &App) -> FocusHandle
fn focus_handle(&self, _: &App) -> FocusHandle
Returns the focus handle associated with this view.
Auto Trait Implementations§
impl !RefUnwindSafe for TreeState
impl !Send for TreeState
impl !Sync for TreeState
impl !UnwindSafe for TreeState
impl Forget for TreeState
impl Freeze for TreeStatewhere
NonZero<u32>: Freeze,
*const ArcInner<RwLock<RawRwLock, FocusMap>> is !null: Freeze,
PhantomData<ArcInner<RwLock<RawRwLock, FocusMap>>>: Freeze,
*const u8 is !null: Freeze,
PhantomData<TreeEntry>: Freeze,
*const RcInner<RefCell<UniformListScrollState>> is !null: Freeze,
PhantomData<RcInner<RefCell<UniformListScrollState>>>: Freeze,
*const RcInner<dyn Fn(usize, &TreeEntry, TreeEntryState, &mut Window, &mut App) -> AnyElement> is !null: Freeze,
PhantomData<RcInner<dyn Fn(usize, &TreeEntry, TreeEntryState, &mut Window, &mut App) -> AnyElement>>: Freeze,
PhantomData<BoxShadow>: Freeze,
&'static str: Freeze,
*const ArcInner<str> is !null: Freeze,
PhantomData<ArcInner<str>>: Freeze,
*const ArcInner<Vec<(String, u32)>> is !null: Freeze,
PhantomData<ArcInner<Vec<(String, u32)>>>: Freeze,
*const ArcInner<Vec<String>> is !null: Freeze,
PhantomData<ArcInner<Vec<String>>>: Freeze,
impl Move for TreeState
impl Unpin for TreeStatewhere
NonZero<u32>: Unpin,
Arc<RwLock<RawRwLock, FocusMap>>: Unpin,
*const u8 is !null: Unpin,
&'static str: Unpin,
Arc<str>: Unpin,
Rc<RefCell<TreeItemState>>: Unpin,
Rc<RefCell<UniformListScrollState>>: Unpin,
Rc<dyn Fn(usize, &TreeEntry, TreeEntryState, &mut Window, &mut App) -> AnyElement>: Unpin,
Arc<Vec<(String, u32)>>: Unpin,
Arc<Vec<String>>: Unpin,
impl UnsafeUnpin for TreeStatewhere
NonZeroU32Inner: UnsafeUnpin,
*const ArcInner<RwLock<RawRwLock, FocusMap>> is !null: UnsafeUnpin,
PhantomData<ArcInner<RwLock<RawRwLock, FocusMap>>>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<TreeEntry>: UnsafeUnpin,
*const RcInner<RefCell<UniformListScrollState>> is !null: UnsafeUnpin,
PhantomData<RcInner<RefCell<UniformListScrollState>>>: UnsafeUnpin,
*const RcInner<dyn Fn(usize, &TreeEntry, TreeEntryState, &mut Window, &mut App) -> AnyElement> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Fn(usize, &TreeEntry, TreeEntryState, &mut Window, &mut App) -> AnyElement>>: UnsafeUnpin,
PhantomData<BoxShadow>: UnsafeUnpin,
&'static str: UnsafeUnpin,
*const ArcInner<str> is !null: UnsafeUnpin,
PhantomData<ArcInner<str>>: UnsafeUnpin,
*const ArcInner<Vec<(String, u32)>> is !null: UnsafeUnpin,
PhantomData<ArcInner<Vec<(String, u32)>>>: UnsafeUnpin,
*const ArcInner<Vec<String>> is !null: UnsafeUnpin,
PhantomData<ArcInner<Vec<String>>>: 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ErasedDestructor for Twhere
T: 'static,
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