pub struct HistoryData {
pub contributions: Vec<Contribution>,
}Expand description
Container for all contribution history.
Fields§
§contributions: Vec<Contribution>List of contributions.
Implementations§
Source§impl HistoryData
impl HistoryData
Sourcepub fn total_tokens(&self) -> u64
pub fn total_tokens(&self) -> u64
Calculate total tokens used across all contributions.
Sourcepub fn total_cost(&self) -> f64
pub fn total_cost(&self) -> f64
Calculate total cost in USD across all contributions.
Sourcepub fn avg_tokens_per_triage(&self) -> f64
pub fn avg_tokens_per_triage(&self) -> f64
Calculate average tokens per triage.
Sourcepub fn cost_by_model(&self) -> HashMap<String, f64>
pub fn cost_by_model(&self) -> HashMap<String, f64>
Calculate total cost grouped by model.
Trait Implementations§
Source§impl Debug for HistoryData
impl Debug for HistoryData
Source§impl Default for HistoryData
impl Default for HistoryData
Source§fn default() -> HistoryData
fn default() -> HistoryData
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for HistoryData
impl<'de> Deserialize<'de> for HistoryData
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for HistoryData
impl RefUnwindSafe for HistoryData
impl Send for HistoryData
impl Sync for HistoryData
impl Unpin for HistoryData
impl UnwindSafe for HistoryData
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
Source§impl<T> FromResponse for Twhere
T: DeserializeOwned,
impl<T> FromResponse for Twhere
T: DeserializeOwned,
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>
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 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>
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