pub enum SelectionWrap {
Clamp,
Wrap,
}Expand description
How ListState::select_next/select_previous behave when the
selection is already at the first/last item.
Defaults to Clamp, matching ratatui’s ListState (select_next/
select_previous saturating_add/clamp at the ends; wraparound is left to the caller, e.g.
via (selected + 1) % len). Older tui-rs-style wraparound is available via Wrap
for callers that want circular menu navigation instead.
Variants§
Clamp
Stop at the first/last item: select_next past the last item stays on the last item, and
select_previous before the first item stays on the first.
Wrap
Wrap around: select_next past the last item lands on the first, and select_previous
before the first item lands on the last.
Trait Implementations§
Source§impl Clone for SelectionWrap
impl Clone for SelectionWrap
Source§fn clone(&self) -> SelectionWrap
fn clone(&self) -> SelectionWrap
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 moreimpl Copy for SelectionWrap
Source§impl Debug for SelectionWrap
impl Debug for SelectionWrap
Source§impl Default for SelectionWrap
impl Default for SelectionWrap
Source§fn default() -> SelectionWrap
fn default() -> SelectionWrap
Returns the “default value” for a type. Read more
impl Eq for SelectionWrap
Source§impl PartialEq for SelectionWrap
impl PartialEq for SelectionWrap
impl StructuralPartialEq for SelectionWrap
Auto Trait Implementations§
impl Freeze for SelectionWrap
impl RefUnwindSafe for SelectionWrap
impl Send for SelectionWrap
impl Sync for SelectionWrap
impl Unpin for SelectionWrap
impl UnsafeUnpin for SelectionWrap
impl UnwindSafe for SelectionWrap
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