pub struct CycleState {
pub selected: usize,
}Expand description
The mode’s cursor state. Session-only; the selected index is over the
entries (never a group heading), so j/k walk cycles and nothing
else.
Fields§
§selected: usizeImplementations§
Source§impl CycleState
impl CycleState
Sourcepub fn move_selected(&mut self, delta: isize, len: usize)
pub fn move_selected(&mut self, delta: isize, len: usize)
Move the cursor, clamped to len entries.
Sourcepub fn move_group(&mut self, groups: &[CycleGrouping], delta: isize)
pub fn move_group(&mut self, groups: &[CycleGrouping], delta: isize)
Jump to the first entry of the group delta groups away, clamped at the
ends: h in the first section and l in the last stay in that section
rather than wrapping (tui-cycle-mode).
Only groups that actually have entries are landing sites. An empty section renders nothing, so jumping to it would be a keystroke with no visible effect; skipping it is what “the rendered groups” means.
Trait Implementations§
Source§impl Clone for CycleState
impl Clone for CycleState
impl Copy for CycleState
Source§impl Debug for CycleState
impl Debug for CycleState
Source§impl Default for CycleState
impl Default for CycleState
impl Eq for CycleState
Source§impl PartialEq for CycleState
impl PartialEq for CycleState
impl StructuralPartialEq for CycleState
Auto Trait Implementations§
impl Freeze for CycleState
impl RefUnwindSafe for CycleState
impl Send for CycleState
impl Sync for CycleState
impl Unpin for CycleState
impl UnsafeUnpin for CycleState
impl UnwindSafe for CycleState
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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