TreeListViewState

Struct TreeListViewState 

Source
pub struct TreeListViewState<Id> { /* private fields */ }
Expand description

Состояние виджета: развёрнутые узлы, выделение, кеши видимости и меток.

Implementations§

Source§

impl<Id: Copy + Eq + Hash> TreeListViewState<Id>

Source

pub fn new() -> Self

Source

pub fn with_capacity(capacity: usize) -> Self

Source

pub fn snapshot(&self) -> TreeListViewSnapshot<Id>

Source

pub fn restore(&mut self, snapshot: TreeListViewSnapshot<Id>)

Source

pub const fn draw_lines(&self) -> bool

Source

pub const fn set_draw_lines(&mut self, draw: bool)

Source

pub const fn invalidate(&mut self)

Source

pub const fn invalidate_all(&mut self)

Source

pub const fn select_first(&mut self)

Source

pub const fn select_last(&mut self)

Source

pub fn scroll_down_by(&mut self, amount: u16)

Source

pub fn scroll_up_by(&mut self, amount: u16)

Source

pub fn select_prev(&mut self)

Source

pub fn select_next(&mut self)

Source

pub fn ensure_selection_visible(&mut self, viewport_height: usize)

Source

pub fn ensure_selection_visible_with_policy( &mut self, viewport_height: usize, policy: TreeScrollPolicy, )

Source

pub fn selected_id(&self) -> Option<Id>

Source

pub fn selected_parent_id(&self) -> Option<Id>

Source

pub const fn visible_len(&self) -> usize

Source

pub fn selected_level(&self) -> Option<u16>

Source

pub fn selected_is_expanded<T: TreeModel<Id = Id>>( &self, model: &T, ) -> Option<bool>

Source

pub fn select_by_id<T: TreeModel<Id = Id>>(&mut self, model: &T, id: Id) -> bool

Source

pub fn ensure_visible_id<T: TreeModel<Id = Id>>( &mut self, model: &T, id: Id, ) -> bool

Source

pub fn expand_to<T: TreeModel<Id = Id>>(&mut self, model: &T, id: Id) -> bool

Source

pub fn expand_all<T: TreeModel<Id = Id>>(&mut self, model: &T)

Source

pub fn collapse_all(&mut self)

Source

pub fn ensure_visible_nodes<T: TreeModel<Id = Id>>(&mut self, model: &T)

Source

pub fn ensure_visible_nodes_filtered<T, F>( &mut self, model: &T, filter: &F, config: TreeFilterConfig, )
where T: TreeModel<Id = Id>, F: TreeFilter<T>,

Source

pub fn ensure_mark_cache<T: TreeModel<Id = Id>>(&mut self, model: &T)

Source

pub fn node_is_marked(&self, node_id: Id) -> bool

Source

pub fn prune_removed_marks<T: TreeModel<Id = Id>>(&mut self, model: &T)

Source

pub fn handle_action<T: TreeModel<Id = Id>, C>( &mut self, model: &T, action: TreeAction<C>, ) -> TreeEvent<C>

Source

pub fn handle_action_filtered<T, F, C>( &mut self, model: &T, filter: &F, config: TreeFilterConfig, action: TreeAction<C>, ) -> TreeEvent<C>
where T: TreeModel<Id = Id>, F: TreeFilter<T>,

Source

pub fn toggle(&mut self, node_id: Id, parent: Option<Id>)

Source

pub fn set_expanded(&mut self, node_id: Id, parent: Option<Id>, expand: bool)

Trait Implementations§

Source§

impl<Id: Copy + Eq + Hash> Default for TreeListViewState<Id>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<Id> Freeze for TreeListViewState<Id>

§

impl<Id> RefUnwindSafe for TreeListViewState<Id>
where Id: RefUnwindSafe,

§

impl<Id> Send for TreeListViewState<Id>
where Id: Send,

§

impl<Id> Sync for TreeListViewState<Id>
where Id: Sync,

§

impl<Id> Unpin for TreeListViewState<Id>
where Id: Unpin,

§

impl<Id> UnwindSafe for TreeListViewState<Id>
where Id: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.