pub struct WrappedReport {Show 14 fields
pub period: String,
pub tokens_saved: u64,
pub tokens_input: u64,
pub cost_avoided_usd: f64,
pub total_commands: u64,
pub sessions_count: usize,
pub top_commands: Vec<(String, u64, f64)>,
pub compression_rate_pct: f64,
pub files_touched: u64,
pub daily_savings: Vec<u64>,
pub bounce_tokens: u64,
pub model_key: String,
pub pricing_estimated: bool,
pub percentile: Option<u8>,
}Fields§
§period: String§tokens_saved: u64§tokens_input: u64§cost_avoided_usd: f64§total_commands: u64§sessions_count: usize§top_commands: Vec<(String, u64, f64)>§compression_rate_pct: f64§files_touched: u64§daily_savings: Vec<u64>§bounce_tokens: u64Tokens netted out of tokens_saved because a compressed read later bounced to a
full re-read (G7). Sourced from the persistent savings ledger for the period.
model_key: StringResolved pricing model key used to value the saved tokens (e.g. “claude-3.5-sonnet”).
pricing_estimated: boolTrue when no model could be resolved and a blended fallback price was used. Surfaced everywhere so an estimate is never presented as a precise figure.
percentile: Option<u8>Estimated percentile rank among lean-ctx users (0-100). Based on tokens saved. None if insufficient data or user hasn’t opted into community metrics.
Implementations§
Source§impl WrappedReport
impl WrappedReport
pub fn generate(period: &str) -> Self
Sourcepub fn methodology_line(&self) -> String
pub fn methodology_line(&self) -> String
One-line, conservative explanation of how the headline numbers were derived. Reused by the ASCII footer, the compact summary, and the SVG share card so the figure is always explainable and never over-claimed.
Sourcepub fn format_ascii(&self) -> String
pub fn format_ascii(&self) -> String
Renders a premium, shareable “Wrapped” card. Colors are emitted only when
stdout is a TTY (see theme::no_color), so piping to a file or social post
yields clean copy-pasteable ASCII.
pub fn format_compact(&self) -> String
Source§impl WrappedReport
impl WrappedReport
Renders the self-contained share page. base_url (optional) is the location the
user will host the page at; when present, absolute OG/Twitter image meta is emitted.
A ready-to-post one-liner for gain --copy. The opt-in permalink url
(once published) is appended when present. Honest about the estimate marker.
Auto Trait Implementations§
impl Freeze for WrappedReport
impl RefUnwindSafe for WrappedReport
impl Send for WrappedReport
impl Sync for WrappedReport
impl Unpin for WrappedReport
impl UnsafeUnpin for WrappedReport
impl UnwindSafe for WrappedReport
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
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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