pub struct ObjectListState { /* private fields */ }Expand description
State for the object list widget.
Implementations§
Source§impl ObjectListState
impl ObjectListState
Sourcepub fn new(objects: Vec<ObjectInfo>) -> Self
pub fn new(objects: Vec<ObjectInfo>) -> Self
Create a new object list state.
Sourcepub fn selected_object(&self) -> Option<&ObjectInfo>
pub fn selected_object(&self) -> Option<&ObjectInfo>
Get the currently selected object.
Sourcepub fn selected_index(&self) -> usize
pub fn selected_index(&self) -> usize
Get the selected absolute index.
Sourcepub fn select_next(&mut self, viewport_height: usize)
pub fn select_next(&mut self, viewport_height: usize)
Move selection down by one.
Sourcepub fn select_prev(&mut self)
pub fn select_prev(&mut self)
Move selection up by one.
Sourcepub fn scroll_down_half(&mut self, viewport_height: usize)
pub fn scroll_down_half(&mut self, viewport_height: usize)
Move selection down by half a page.
Sourcepub fn scroll_up_half(&mut self, viewport_height: usize)
pub fn scroll_up_half(&mut self, viewport_height: usize)
Move selection up by half a page.
Sourcepub fn scroll_down_page(&mut self, viewport_height: usize)
pub fn scroll_down_page(&mut self, viewport_height: usize)
Move selection down by a full page.
Sourcepub fn scroll_up_page(&mut self, viewport_height: usize)
pub fn scroll_up_page(&mut self, viewport_height: usize)
Move selection up by a full page.
Sourcepub fn select_first(&mut self)
pub fn select_first(&mut self)
Jump to the first object.
Sourcepub fn select_last(&mut self, viewport_height: usize)
pub fn select_last(&mut self, viewport_height: usize)
Jump to the last object.
Sourcepub fn update_object(&mut self, index: usize, info: ObjectInfo)
pub fn update_object(&mut self, index: usize, info: ObjectInfo)
Update an object’s info (used for lazy categorization).
Sourcepub fn get_object_mut(&mut self, index: usize) -> Option<&mut ObjectInfo>
pub fn get_object_mut(&mut self, index: usize) -> Option<&mut ObjectInfo>
Get a mutable reference to an object for updating.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ObjectListState
impl RefUnwindSafe for ObjectListState
impl Send for ObjectListState
impl Sync for ObjectListState
impl Unpin for ObjectListState
impl UnsafeUnpin for ObjectListState
impl UnwindSafe for ObjectListState
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