pub struct StatefulList<T: Display + Id + Clone> {
pub search_text: String,
pub selected: Vec<String>,
pub multiselect: bool,
pub title: String,
pub state: ListState,
pub items: Vec<T>,
}Fields§
§search_text: String§selected: Vec<String>§multiselect: bool§title: String§state: ListState§items: Vec<T>Implementations§
Source§impl<T: Display + Id + Clone> StatefulList<T>
impl<T: Display + Id + Clone> StatefulList<T>
pub fn with_items( items: Vec<T>, title: String, multiselect: bool, ) -> StatefulList<T>
pub fn search(&self, query: &str) -> Vec<T>
pub fn clear_selected(&mut self)
pub fn get_by_id(&self, id: String) -> Option<&T>
pub fn toggle_highlighted(&mut self)
pub fn next(&mut self)
pub fn previous(&mut self)
pub fn get_highlighted_item(&self) -> Option<&T>
pub fn get_selected_item(&self) -> Option<&T>
pub fn get_selected_items(&self) -> Vec<&T>
Trait Implementations§
Source§impl<T: Clone + Display + Id + Clone> Clone for StatefulList<T>
impl<T: Clone + Display + Id + Clone> Clone for StatefulList<T>
Source§fn clone(&self) -> StatefulList<T>
fn clone(&self) -> StatefulList<T>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<T> Freeze for StatefulList<T>
impl<T> RefUnwindSafe for StatefulList<T>where
T: RefUnwindSafe,
impl<T> Send for StatefulList<T>where
T: Send,
impl<T> Sync for StatefulList<T>where
T: Sync,
impl<T> Unpin for StatefulList<T>where
T: Unpin,
impl<T> UnsafeUnpin for StatefulList<T>
impl<T> UnwindSafe for StatefulList<T>where
T: UnwindSafe,
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