pub struct TimeSeries {
pub bucket: Bucket,
pub labels: Vec<String>,
pub tokens: Vec<[u64; 8]>,
pub cost: Vec<[f64; 8]>,
}Expand description
Per-bucket, per-tool totals: values[bucket][tool.series_index()].
Fields§
§bucket: Bucket§labels: Vec<String>One label per bucket, oldest first (2026-05-01, 2026-05, 2026-05-01 13:00).
tokens: Vec<[u64; 8]>§cost: Vec<[f64; 8]>Implementations§
Source§impl TimeSeries
impl TimeSeries
pub fn is_empty(&self) -> bool
Sourcepub fn value(&self, metric: Metric, i: usize, tool: Tool) -> f64
pub fn value(&self, metric: Metric, i: usize, tool: Tool) -> f64
The value of tool in bucket i for metric.
Sourcepub fn bucket_total(&self, metric: Metric, i: usize) -> f64
pub fn bucket_total(&self, metric: Metric, i: usize) -> f64
Total of all tools in bucket i.
Sourcepub fn active_tools(&self, metric: Metric) -> Vec<Tool>
pub fn active_tools(&self, metric: Metric) -> Vec<Tool>
Tools that have any value for metric, in canonical order (the legend).
Source§impl TimeSeries
impl TimeSeries
Sourcepub fn in_currency(&self, currency: &Currency) -> TimeSeries
pub fn in_currency(&self, currency: &Currency) -> TimeSeries
The same series with every cost converted from US dollars to currency
(tokens are untouched), ready to be drawn with that currency’s axis labels.
Trait Implementations§
Source§impl Clone for TimeSeries
impl Clone for TimeSeries
Source§impl Debug for TimeSeries
impl Debug for TimeSeries
Source§impl Default for TimeSeries
impl Default for TimeSeries
Source§impl PartialEq for TimeSeries
impl PartialEq for TimeSeries
impl StructuralPartialEq for TimeSeries
Auto Trait Implementations§
impl Freeze for TimeSeries
impl RefUnwindSafe for TimeSeries
impl Send for TimeSeries
impl Sync for TimeSeries
impl Unpin for TimeSeries
impl UnsafeUnpin for TimeSeries
impl UnwindSafe for TimeSeries
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
Mutably borrows from an owned value. Read more