Skip to main content

WrappedReport

Struct WrappedReport 

Source
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: u64

Tokens 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: String

Resolved pricing model key used to value the saved tokens (e.g. “claude-3.5-sonnet”).

§pricing_estimated: bool

True 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

Source

pub fn generate(period: &str) -> Self

Source

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.

Source

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.

Source

pub fn format_compact(&self) -> String

Source§

impl WrappedReport

Source

pub fn to_share_html(&self, base_url: Option<&str>) -> String

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.

Source

pub fn share_text(&self, url: Option<&str>) -> String

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.

Source§

impl WrappedReport

Source

pub fn to_svg(&self) -> String

Renders a polished, dependency-free SVG share card.

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<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

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

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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