pub struct ListState { /* private fields */ }Expand description
The list’s groups, selection, folded groups, panel and load status, and its scroll position.
Implementations§
Source§impl ListState
impl ListState
pub fn new(groups: Vec<Group>) -> Self
pub fn groups(&self) -> &[Group]
Sourcepub fn set_groups(&mut self, groups: Vec<Group>)
pub fn set_groups(&mut self, groups: Vec<Group>)
Replace the groups. The selection stays when its key is still shown.
pub fn status(&self) -> &LoadStatus
pub fn set_status(&mut self, status: LoadStatus)
pub fn rows(&self) -> impl Iterator<Item = &Row>
pub fn selected(&self) -> Option<&SharedString>
pub fn is_folded(&self, group: &str) -> bool
Sourcepub fn selected_row(&self) -> Option<&Row>
pub fn selected_row(&self) -> Option<&Row>
The selected row, when a row (not a group header) is selected.
Sourcepub fn scroll_handle(&self) -> &ScrollHandle
pub fn scroll_handle(&self) -> &ScrollHandle
The list’s scroll handle, for a dashboard that draws the rows itself.
Sourcepub fn scroll_to_selected(&self)
pub fn scroll_to_selected(&self)
Scroll the selected line into view at the next render. Selection
changes through ListState ask for this themselves.
Sourcepub fn take_scroll_request(&self) -> Option<usize>
pub fn take_scroll_request(&self) -> Option<usize>
Takes the pending scroll request: the selected line’s position among the visible lines, when one is pending.
Sourcepub fn visible_keys(&self) -> Vec<SharedString>
pub fn visible_keys(&self) -> Vec<SharedString>
Keys in display order: each group header, then its rows unless folded.
pub fn select(&mut self, key: SharedString)
Sourcepub fn step(&mut self, step: isize)
pub fn step(&mut self, step: isize)
Move the selection by step visible lines; the first move selects
the first line. Stops at either end.
Sourcepub fn select_end(&mut self, last: bool)
pub fn select_end(&mut self, last: bool)
Select the first (last false) or the last visible line.
Sourcepub fn step_row(&mut self, step: isize) -> Option<SharedString>
pub fn step_row(&mut self, step: isize) -> Option<SharedString>
The panel’s previous and next: move to the next visible row, skipping group headers, and keep the panel open. Returns the new row’s key.
Sourcepub fn activate(&mut self) -> Option<SharedString>
pub fn activate(&mut self) -> Option<SharedString>
Enter: fold or unfold a selected group, or open a selected row. Returns the key of the row whose details opened.
Sourcepub fn reveal(&mut self, key: &str) -> bool
pub fn reveal(&mut self, key: &str) -> bool
Show the row key wherever it is: unfold its group, select it and
open its details (REQ-05). False when no row has the key.
pub fn toggle(&mut self, group: &SharedString)
pub fn close_detail(&mut self)
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for ListState
impl !RefUnwindSafe for ListState
impl !Send for ListState
impl !Sync for ListState
impl !UnwindSafe for ListState
impl Forget for ListState
impl Move for ListState
impl Unpin for ListState
impl UnsafeUnpin for ListStatewhere
*const u8 is !null: UnsafeUnpin,
PhantomData<Group>: UnsafeUnpin,
PhantomData<(SharedString, ())>: UnsafeUnpin,
&'static str: UnsafeUnpin,
*const ArcInner<str> is !null: UnsafeUnpin,
PhantomData<ArcInner<str>>: UnsafeUnpin,
*const RcInner<RefCell<ScrollHandleState>> is !null: UnsafeUnpin,
PhantomData<RcInner<RefCell<ScrollHandleState>>>: 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.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> ⓘ
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> ⓘ
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 moreSource§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
Source§type NoneType = T
type NoneType = T
NoneValue::null_value produces.Source§fn null_value() -> T
fn null_value() -> T
impl<T> ParallelSend for T
Source§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().