pub struct WindowRow<'a> {
pub marker_pct: Option<i32>,
pub glyph: Option<&'static str>,
pub detail: Option<&'a str>,
}Expand description
Optional decorations for a push_window row. Default reproduces the
plain row every vendor drew before pacing reached the tooltip: bar +
percentage, then ⏱ Resets in ….
glyph and detail are inserted into Pango markup as-is, so a caller
passing anything vendor-reported must escape it first.
Fields§
§marker_pct: Option<i32>Elapsed-time marker drawn inside the bar (--tooltip-pace-pts).
glyph: Option<&'static str>Pace glyph appended after the bold percentage (↑ / → / ↓).
detail: Option<&'a str>Extra dim text appended to the reset line — Kimi’s 2 / 100 counters,
which the bar’s percentage summarises but does not spell out.
Implementations§
Source§impl<'a> WindowRow<'a>
impl<'a> WindowRow<'a>
Sourcepub fn paced(
w: &UsageWindow,
now: DateTime<Utc>,
tolerance: u32,
point_mode: bool,
) -> Self
pub fn paced( w: &UsageWindow, now: DateTime<Utc>, tolerance: u32, point_mode: bool, ) -> Self
The Anthropic tooltip’s pace convention in one place (mirrors
widget::render::pick_pace_glyph): the ratio glyph by default, and with
point_mode (--tooltip-pace-pts) the point-delta glyph plus the
elapsed marker inside the bar.
A window with no reported reset degrades to pacing::Pacing::neutral(),
so it still gets a → rather than a blank where every sibling row has
a glyph.
Sourcepub fn with_detail(self, detail: &'a str) -> Self
pub fn with_detail(self, detail: &'a str) -> Self
Same row, carrying an extra dim fragment on the reset line.
Trait Implementations§
impl<'a> Copy for WindowRow<'a>
Auto Trait Implementations§
impl<'a> Freeze for WindowRow<'a>
impl<'a> RefUnwindSafe for WindowRow<'a>
impl<'a> Send for WindowRow<'a>
impl<'a> Sync for WindowRow<'a>
impl<'a> Unpin for WindowRow<'a>
impl<'a> UnsafeUnpin for WindowRow<'a>
impl<'a> UnwindSafe for WindowRow<'a>
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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