Skip to main content

App

Struct App 

Source
pub struct App {
Show 18 fields pub selected: usize, pub filter: String, pub mode: Mode, pub status: Option<String>, pub color: bool, pub page_rows: usize, pub tab: Tab, pub daemon_up: bool, pub scorer: Option<String>, pub screen: Screen, pub splash_frame: usize, pub vault: Option<SealedVault>, pub authed: bool, pub login_input: Zeroizing<String>, pub login_error: Option<String>, pub settings: Option<LockedSettings>, pub settings_selected: usize, pub settings_status: Option<String>, /* private fields */
}
Expand description

The whole UI state.

Fields§

§selected: usize

Selection index into the filtered view.

§filter: String

The active filter string.

§mode: Mode

Current mode.

§status: Option<String>

A transient status message (e.g. the result of an undo).

§color: bool

Whether to use color (respects NO_COLOR).

§page_rows: usize

Number of timeline data-rows visible in the last render, used as the step for PageUp/PageDown. Set by the renderer each frame; 0 until the first.

§tab: Tab

The active top-level view.

§daemon_up: bool

Whether the daemon answered on the last refresh (for the vitals strip).

§scorer: Option<String>

The active Tier-2 scorer backend id, if the daemon reported one.

§screen: Screen

The current top-level screen (splash → [login] → main).

§splash_frame: usize

Animation frame for the launch splash (advanced by the event loop).

§vault: Option<SealedVault>

The sealed admin vault, when settings are locked (drives the login gate).

§authed: bool

Whether the admin password has been entered this session.

§login_input: Zeroizing<String>

The password being typed on the login screen (never echoed verbatim). Zeroized on drop and on a failed attempt so a wrong guess isn’t left in freed heap.

§login_error: Option<String>

The last login error, shown under the prompt.

§settings: Option<LockedSettings>

The decrypted locked settings (populated on entering the Settings screen).

§settings_selected: usize

Selection index on the Settings screen.

§settings_status: Option<String>

Transient result/error line on the Settings screen.

Implementations§

Source§

impl App

Source

pub fn new(color: bool) -> Self

Source

pub fn settings_editable(&self) -> bool

Whether locked settings can be edited (provisioned + authenticated).

Source

pub fn open_settings(&mut self)

Open the Settings control panel. Decrypts the live settings when we can; otherwise falls back to defaults shown read-only (unprovisioned host).

Source

pub fn toggle_selected_setting(&mut self)

Toggle the selected setting and re-seal the vault. Read-only when the host isn’t provisioned/authenticated (then it only explains, never pretends).

Source

pub fn start_on_splash(&mut self)

Begin on the animated launch splash (used by run() at startup).

Source

pub fn set_vault(&mut self, vault: Option<SealedVault>)

Attach the loaded vault state. A Locked vault gates the app behind the admin password; Unprovisioned/Degraded leave it open (viewing the audit log was never password-gated — only changing settings is).

Source

pub fn needs_login(&self) -> bool

Whether the password gate must be shown before the app.

Source

pub fn submit_login(&mut self)

Submit the typed password. On success, authenticate and enter the app; on failure, clear the field and show an error. The password never appears on the wire or in a log — only a constant-time verify against the vault.

Source

pub fn tick_splash(&mut self) -> bool

Advance the splash animation one tick; once it completes, enter the app. Returns true while the splash is still showing (so the loop keeps the fast animation cadence).

Source

pub fn vitals(&self) -> (usize, usize, usize)

Counts for the header vitals strip: (total, held, catastrophic) over the full loaded set (not the filtered/tab slice — vitals are global).

Source

pub fn select_tab(&mut self, tab: Tab)

Switch to a specific tab, resetting selection to the top of its slice.

Source

pub fn set_events(&mut self, events: Vec<LoggedEvent>)

Replace the event set (from a fresh log read), keeping selection in range.

Source

pub fn filtered_indices(&self) -> Vec<usize>

Indices into events that match the active tab’s slice AND the current filter (both must hold — the tab narrows, the filter narrows further).

Source

pub fn visible(&self) -> Vec<&LoggedEvent>

The events currently visible (after filtering), in display order.

Source

pub fn selected_event(&self) -> Option<&LoggedEvent>

The currently selected event, if any.

Source

pub fn is_empty(&self) -> bool

Whether there are no events at all (for the empty state).

Source

pub fn on_key(&mut self, key: KeyCode) -> Action

Handle a keypress, returning any side-effecting action for the loop.

Auto Trait Implementations§

§

impl Freeze for App

§

impl RefUnwindSafe for App

§

impl Send for App

§

impl Sync for App

§

impl Unpin for App

§

impl UnsafeUnpin for App

§

impl UnwindSafe for App

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

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

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

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

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<T> WithSubscriber for T

Source§

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

fn with_current_subscriber(self) -> WithDispatch<Self>

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