Skip to main content

StatusItem

Enum StatusItem 

Source
pub enum StatusItem {
    Mode,
    Model,
    Cost,
    Cache,
    ContextPercent,
    Tokens,
    Balance,
    SessionMetrics,
    Ttft,
    OutputRate,
    Workspace,
    GitBranch,
}
Expand description

One configurable bottom-chrome item.

Every variant owns exactly one thing on screen, and /statusline turns that thing on or off:

VariantWhat it paints
Modethe posture bar’s plan/act/operate chip
Modelthe metrics line’s route segment
ContextPercentthe metrics line’s ctx NN% reading
Costthe metrics line’s session price
SessionMetricsthe metrics line’s ttft and tok/s
Cachethe metrics line’s cache NN%
Tokensthe metrics line’s ↓ NNN output tokens
Balancethe metrics line’s prepaid-credit reading (also gates the fetch)
Workspacethe metrics line’s workspace leaf-directory chip
GitBranchthe metrics line’s current-branch chip (short SHA when detached)

A variant that paints nothing does not belong here. Eight variants were retired in #5950 because the 0.9.12 shell gave their facts to a surface /statusline does not own — the posture bar’s clock and live counts (Status, Agents), the launch header and git dock (GitBranch) — or because they were never wired at all (ReasoningReplay, PrefixStability, LastToolElapsed, RateLimit). #6112 revived GitBranch (and added Workspace) as opt-in metrics-line chips fed by the cached workspace context, not by a per-frame git call. The other retired keys still parse out of an old config.toml: StatusItem::from_key returns None and deser_status_items skips them with a warning, so an upgrader’s file keeps loading.

Variants§

§

Mode

“act” / “plan” / “operate” chip.

§

Model

Model identifier (e.g. deepseek-v4-pro).

§

Cost

Session cost in the configured display currency.

§

Cache

Cache hit rate (“cache 73%”).

§

ContextPercent

Context-window utilisation percent (“ctx 48%”).

§

Tokens

Output tokens of the live or last turn (“↓ 1.2K”).

§

Balance

Prepaid remaining credit, refreshed once per turn completion.

§

SessionMetrics

Legacy configuration alias enabling both TTFT and output rate. The picker expands it into independently editable readings.

§

Ttft

Mean measured time from request dispatch to the first token.

§

OutputRate

Provider output tokens divided by measured request time.

§

Workspace

Leaf directory of the session workspace, left-truncated when long. Opt-in (#6112); off the default footer.

§

GitBranch

Current git branch from the cached workspace context — the short SHA when HEAD is detached, absent outside a repository. Opt-in (#6112); off the default footer.

Implementations§

Source§

impl StatusItem

Default footer composition for the always-on status line. Used when tui.status_items is missing from config.toml so upgraders see a concise footer by default; diagnostic chips remain available via /statusline without crowding the main UI.

Source

pub fn key(self) -> &'static str

Stable canonical name used in TOML and the picker label.

Source

pub fn from_key(key: &str) -> Option<Self>

Reverse of key: parse a config string back to a variant. Returns None for unknown keys so the config parser can silently skip items added by newer versions rather than crashing with “unknown variant”.

Source

pub fn label(self) -> &'static str

Human-readable label for the picker.

Source

pub fn hint(self, locale: Locale) -> Cow<'static, str>

One-line hint shown beside the label so the user knows what each item surfaces without having to toggle it on first.

Source

pub fn all() -> &'static [StatusItem]

Editable items in display order. Legacy combined metrics parse but expand to the two individual controls instead of appearing twice.

Source

pub fn is_available_for(self, provider: ProviderKind) -> bool

Whether this item is relevant for provider. Provider-specific items return false for unsupported providers so the picker doesn’t offer toggles that can never show useful data.

Trait Implementations§

Source§

impl Clone for StatusItem

Source§

fn clone(&self) -> Self

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 Copy for StatusItem

Source§

impl Debug for StatusItem

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for StatusItem

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for StatusItem

Source§

impl Hash for StatusItem

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for StatusItem

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for StatusItem

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for StatusItem

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<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> 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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send> ⓘ

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

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

Source§

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

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> 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> 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 = !

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

fn try_from(value: U) -> Result<T, !>

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