pub struct GridState {
pub list: Watchlist,
pub ready: Option<Ready>,
pub last: Option<Tick>,
pub run: u64,
pub health: Vec<bool>,
pub banner: Option<String>,
pub bell: bool,
pub selected: usize,
pub detail: bool,
pub ended: Option<(String, Style)>,
pub progress: Option<ProgressHook>,
pub stale: bool,
/* private fields */
}Expand description
The grid’s state.
Fields§
§list: WatchlistThe watchlist as the user gave it.
ready: Option<Ready>The watchlist as it runs, once resolved.
last: Option<Tick>The last tick, once there is one.
run: u64The run number of the last tick.
health: Vec<bool>Each run’s health, oldest first (true = no breach).
The banner of the last breach that started, until the next key.
bell: boolTrue once to ring the bell for a new breach; the loop takes it.
selected: usizeThe selected row, in sorted order.
detail: boolThe detail pane of the selected row is open.
ended: Option<(String, Style)>The footer once the run ended (Done, Stopped, or the error).
progress: Option<ProgressHook>The run’s progress (run N of M, next in Ns).
stale: boolsetup saved new settings while the run went on: the run still
uses the ones it started with.
Implementations§
Source§impl GridState
impl GridState
Sourcepub fn new(list: Watchlist, progress: Option<ProgressHook>) -> Self
pub fn new(list: Watchlist, progress: Option<ProgressHook>) -> Self
A grid for list, before its first tick.
Sourcepub fn is_running(&self) -> bool
pub fn is_running(&self) -> bool
Whether the run still goes on.
Sourcepub fn rows(&self) -> Vec<&TargetSnapshot>
pub fn rows(&self) -> Vec<&TargetSnapshot>
The rows in grid order: breached, warned, unknown, passed; the watchlist order within each.
Sourcepub fn evidence(&self, key: char) -> Option<String>
pub fn evidence(&self, key: char) -> Option<String>
The CLI command an evidence key runs for the selected row; in the venue charts, for the venue the legend selects.
Sourcepub fn key(&mut self, key: KeyEvent) -> GridAction
pub fn key(&mut self, key: KeyEvent) -> GridAction
Applies one key.
Sourcepub fn status_part(&self) -> String
pub fn status_part(&self) -> String
The status-line part for the shell screen while a run goes on.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for GridState
impl !RefUnwindSafe for GridState
impl !Sync for GridState
impl Forget for GridState
impl Send for GridState
impl Unpin for GridState
impl UnsafeUnpin for GridState
impl UnwindSafe for GridState
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
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> ⓘ
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> ⓘ
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