Skip to main content

AppModel

Struct AppModel 

Source
pub struct AppModel {
Show 13 fields pub config: ScanConfig, pub builder: BuilderUi, pub fields: Vec<FieldDef>, pub rows: Vec<ScreenerRow>, pub status: String, pub error: Option<String>, pub view: ViewMode, pub scroll: usize, pub ticks: u64, pub max_columns: usize, pub watch: bool, pub watch_interval: Duration, pub last_scan_at: Instant,
}
Expand description

Pane model: config, last rows, status line, active view.

Fields§

§config: ScanConfig

Scan parameters.

§builder: BuilderUi

Builder pane state.

§fields: Vec<FieldDef>

Fields used for the last scan / table columns.

§rows: Vec<ScreenerRow>

Last scan rows.

§status: String

Status / branding line (non-error).

§error: Option<String>

Last error message, if any.

§view: ViewMode

Active view.

§scroll: usize

Vertical scroll offset (results rows or text panes).

§ticks: u64

Refresh counter.

§max_columns: usize

Max data columns in the results table.

§watch: bool

When true, auto-refresh on Self::watch_interval.

§watch_interval: Duration

Auto-refresh period (already floored to MIN_TUI_REFRESH_SECS).

§last_scan_at: Instant

Instant of the last completed scan attempt (success or failure).

Implementations§

Source§

impl AppModel

Source

pub fn new( config: ScanConfig, fields: Vec<FieldDef>, rows: Vec<ScreenerRow>, watch: bool, watch_interval_secs: f64, ) -> Self

Builds a model after an initial scan (or empty rows on failure).

Source

pub fn set_rows(&mut self, fields: Vec<FieldDef>, rows: Vec<ScreenerRow>)

Records a successful scan.

Source

pub fn set_error(&mut self, message: impl Into<String>)

Records a scan failure (keeps previous rows).

Source

pub const fn toggle_help(&mut self)

Toggles Results ↔ Help.

Source

pub fn cycle_view(&mut self)

Cycles Results → Builder → Payload → Codegen.

Source

pub const fn set_view_number(&mut self, n: u8)

Jumps to a numbered pane (1–4).

Source

pub fn toggle_watch(&mut self)

Toggles opt-in auto-refresh (off by default).

Source

pub fn cooldown_secs_remaining(&self) -> u64

Seconds remaining before another scan is allowed (0 when ready).

Source

pub fn can_refresh(&self) -> bool

Returns true when a manual or watch refresh may run (honors TUI floor).

Source

pub fn watch_due(&self) -> bool

Returns true when watch mode is on and the watch interval has elapsed.

Source

pub fn scroll_by(&mut self, delta: isize)

Scrolls the active pane by delta lines.

Source

pub fn builder_focus_by(&mut self, delta: isize)

Moves builder focus up/down.

Source

pub fn step_asset(&mut self, delta: isize)

Cycles asset when the Asset row is focused.

Source

pub fn on_asset_changed(&mut self)

Resets config after an asset switch in the builder.

Source

pub const fn toggle_sort_ascending(&mut self)

Toggles sort direction when the Sort row is focused.

Source

pub fn step_preset(&mut self, delta: isize)

Steps the preset picker and updates config.

Source

pub fn step_limit(&mut self, delta: i32)

Adjusts row limit (minimum 1, maximum 500).

Trait Implementations§

Source§

impl Clone for AppModel

Source§

fn clone(&self) -> AppModel

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for AppModel

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FromRef<T> for T
where T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more