pub struct TipsState {
pub index: usize,
pub disabled: bool,
}Expand description
The modal’s own state, held by crate::app::App as Some exactly while
crate::app::Mode::Tips is active.
Fields§
§index: usizeWhich tip is shown, as an index into crate::tips::all.
disabled: boolWhether the user has just turned the tips off, so the modal is showing the
“you can turn them back on in tix.toml” notice instead of a tip.
Implementations§
Source§impl TipsState
impl TipsState
Sourcepub fn randomize(&mut self, len: usize)
pub fn randomize(&mut self, len: usize)
Jump to a random tip, landing on a different one whenever there is more than one to show.
The “different” part is the point of the key: pressing r to see another
tip and getting the one already on screen reads as a broken key, and with
a random start at open time there is nothing else drawing the seed — this
is the only place the modal asks for one.
Trait Implementations§
impl Eq for TipsState
impl StructuralPartialEq for TipsState
Auto Trait Implementations§
impl Freeze for TipsState
impl RefUnwindSafe for TipsState
impl Send for TipsState
impl Sync for TipsState
impl Unpin for TipsState
impl UnsafeUnpin for TipsState
impl UnwindSafe for TipsState
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