Skip to main content

Module render

Module render 

Source

Structs§

Ink
ANSI styles — cmduse’s palette, or empty strings when colour is off, so a piped run never leaks SGR escapes.

Functions§

bucket_text
Spend per bucket (day or hour), oldest first — cmduse daily/hourly.
date_of
YYYY-MM-DD for a Unix day number (civil-from-days, same helper family as the window module’s).
model_text
plans_text
The catalogue: what each product costs and (for Go) what it allows.
render_json
Machine-readable projection: totals plus the per-model breakdown.
render_text
limit rows to show; usize::MAX for all.
session_text
Spend per session, newest first.
status_line
Compact single line for a status bar.
watch_frame
One watch frame: the dashboard, then a burst sparkline when the 5-hour spend has moved since the previous refresh. No trailing newline — the caller appends its own status line and redraw_frame (cmduse’s) parks the cursor there, which is what lets the countdown rewrite a single line per second.