pub struct RecurringWarning {
pub warnings: Vec<DueWarning>,
pub selected: usize,
}Expand description
The overlay’s own state: the warnings it is showing and the row it is on.
Held by crate::app::App as Some exactly while the overlay is open, so a
closed overlay has no rows to act on — the same arrangement the other modals
use, and the reason an action cannot outlive the warning it answered.
Fields§
§warnings: Vec<DueWarning>The due warnings, in the detector’s order (oldest due first).
selected: usizeThe selected row.
Implementations§
Source§impl RecurringWarning
impl RecurringWarning
Sourcepub fn new(warnings: Vec<DueWarning>) -> Self
pub fn new(warnings: Vec<DueWarning>) -> Self
The overlay for warnings, on the first row.
Sourcepub fn current(&self) -> Option<&DueWarning>
pub fn current(&self) -> Option<&DueWarning>
The warning under the cursor.
Sourcepub fn move_selected(&mut self, delta: isize) -> bool
pub fn move_selected(&mut self, delta: isize) -> bool
Move the cursor by delta, clamped to the rows.
Sourcepub fn remove_current(&mut self)
pub fn remove_current(&mut self)
Drop the row that was just acted on, keeping the cursor in range.
An applied action resolves exactly one warning, so the overlay shrinks by one and stays open for the rest — the user is not sent back to the board to find out that three more occurrences are due.
Trait Implementations§
Source§impl Clone for RecurringWarning
impl Clone for RecurringWarning
Source§impl Debug for RecurringWarning
impl Debug for RecurringWarning
Source§impl Default for RecurringWarning
impl Default for RecurringWarning
impl Eq for RecurringWarning
Source§impl PartialEq for RecurringWarning
impl PartialEq for RecurringWarning
impl StructuralPartialEq for RecurringWarning
Auto Trait Implementations§
impl Freeze for RecurringWarning
impl RefUnwindSafe for RecurringWarning
impl Send for RecurringWarning
impl Sync for RecurringWarning
impl Unpin for RecurringWarning
impl UnsafeUnpin for RecurringWarning
impl UnwindSafe for RecurringWarning
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