pub struct App {
pub tabs_meta: Vec<TabId>,
pub active: usize,
pub tabs: Vec<TabState>,
pub tab_generation: u64,
pub theme: Theme,
pub last_refresh: DateTime<Utc>,
pub quit: bool,
pub settings: Option<SettingsState>,
}Fields§
§tabs_meta: Vec<TabId>§active: usize§tabs: Vec<TabState>§tab_generation: u64Monotonically increasing identity for a complete tab-set replacement. Background fetches carry this with their tab identity so results from a previous Settings reload cannot land in a new tab at the old index.
theme: Theme§last_refresh: DateTime<Utc>§quit: bool§settings: Option<SettingsState>When Some, the Settings overlay is open and consuming key events.
Implementations§
Source§impl App
impl App
pub fn new(tabs_meta: Vec<TabId>) -> Self
Sourcepub fn with_theme(tabs_meta: Vec<TabId>, theme: Theme) -> Self
pub fn with_theme(tabs_meta: Vec<TabId>, theme: Theme) -> Self
Like App::new but with an explicit theme. Lets tests build an App
without reading the real Omarchy theme file
($HOME/.config/omarchy/current/theme/colors.toml) — new resolves
that path and the $HOME env var via merged_with_omarchy, which is
not hermetic. Production code uses new/new_with_primary.
Sourcepub fn new_with_primary(
tabs_meta: Vec<TabId>,
primary: Option<VendorId>,
) -> Self
pub fn new_with_primary( tabs_meta: Vec<TabId>, primary: Option<VendorId>, ) -> Self
Construct with an initial active tab — usually [ui] primary from
config. Silently falls through to index 0 if the requested vendor
isn’t present (e.g. it was disabled).
pub fn active_tab_id(&self) -> Option<&TabId>
pub fn active_vendor(&self) -> Option<VendorId>
Sourcepub fn set_tabs(&mut self, tabs_meta: Vec<TabId>)
pub fn set_tabs(&mut self, tabs_meta: Vec<TabId>)
Replace the tab set — used after a Settings save reloads config, so
tabs added or removed in config.toml while the TUI is open (e.g. a
new [[anthropic.accounts]] entry) appear without a restart. Every
tab resets to Loading (the caller re-spawns fetches) and the
selection is clamped in case the list shrank.
Sourcepub fn apply_refresh(
&mut self,
generation: u64,
tab: &TabId,
state: TabState,
) -> bool
pub fn apply_refresh( &mut self, generation: u64, tab: &TabId, state: TabState, ) -> bool
Apply an asynchronous refresh only when it still belongs to this tab generation and the captured tab identity still exists. Lookup by identity, rather than the old positional index, also makes a reordered tab list safe.
Sourcepub fn select_primary(&mut self, primary: Option<VendorId>)
pub fn select_primary(&mut self, primary: Option<VendorId>)
Move to the first tab of primary’s vendor (the default account tab,
since it precedes any of that vendor’s account tabs).
pub fn next_tab(&mut self)
pub fn prev_tab(&mut self)
Trait Implementations§
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> 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