pub struct AiStats {
pub provider: String,
pub model: String,
pub input_tokens: u64,
pub output_tokens: u64,
pub duration_ms: u64,
pub cost_usd: Option<f64>,
pub fallback_provider: Option<String>,
}Expand description
AI usage statistics for a contribution.
Fields§
§provider: StringProvider name (e.g., “openrouter”, “anthropic”).
model: StringModel used for analysis.
input_tokens: u64Number of input tokens.
output_tokens: u64Number of output tokens.
duration_ms: u64Duration of the API call in milliseconds.
cost_usd: Option<f64>Cost in USD (from OpenRouter API, None if not reported).
fallback_provider: Option<String>Fallback provider used if primary failed (None if primary succeeded).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for AiStats
impl<'de> Deserialize<'de> for AiStats
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
impl StructuralPartialEq for AiStats
Auto Trait Implementations§
impl Freeze for AiStats
impl RefUnwindSafe for AiStats
impl Send for AiStats
impl Sync for AiStats
impl Unpin for AiStats
impl UnsafeUnpin for AiStats
impl UnwindSafe for AiStats
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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