pub struct WizardState {
pub list: Watchlist,
pub notes: Vec<String>,
pub step: Step,
pub target: usize,
pub row: usize,
pub edit: Option<(EditKind, String)>,
pub venues: Vec<String>,
pub dir: PathBuf,
pub dirty: bool,
pub confirm_leave: bool,
pub error: Option<String>,
}Expand description
The wizard’s state.
Fields§
§list: Watchlist§notes: Vec<String>Notes from the arguments (flags that do nothing, dropped alerts).
step: Step§target: usizeThe selected target (Targets and Metrics).
row: usizeThe selected row of the Metrics, Timing or Outputs step.
edit: Option<(EditKind, String)>The line being typed.
venues: Vec<String>The venue IDs a target may name.
dir: PathBufWhere Save writes.
dirty: boolSomething changed since the last save.
confirm_leave: boolEsc asked “Leave without saving?”.
error: Option<String>The last problem, until the next key.
Implementations§
Source§impl WizardState
impl WizardState
Sourcepub fn new(
list: Watchlist,
notes: Vec<String>,
venues: Vec<String>,
dir: PathBuf,
) -> Self
pub fn new( list: Watchlist, notes: Vec<String>, venues: Vec<String>, dir: PathBuf, ) -> Self
A wizard over list. dir holds the saved watchlists.
Sourcepub fn key(&mut self, key: KeyEvent) -> WizardAction
pub fn key(&mut self, key: KeyEvent) -> WizardAction
Applies one key.
Sourcepub fn metric_rows(&self) -> Vec<Option<MetricId>>
pub fn metric_rows(&self) -> Vec<Option<MetricId>>
The Metrics rows of the selected target: the preset (when the kind takes market metrics), then the kind’s metrics.
Trait Implementations§
Auto Trait Implementations§
impl Forget for WizardState
impl Freeze for WizardState
impl RefUnwindSafe for WizardState
impl Send for WizardState
impl Sync for WizardState
impl Unpin for WizardState
impl UnsafeUnpin for WizardState
impl UnwindSafe for WizardState
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> 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> ⓘ
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