pub struct UsageRecord {
pub id: u64,
pub occurred_at: DateTime<Utc>,
pub operation: String,
pub model: String,
pub service_tier: ServiceTier,
pub succeeded: bool,
pub provider_request_id: Option<String>,
pub failure_kind: Option<String>,
pub usage: TokenUsage,
pub cost: CostBreakdown,
}Expand description
One in-memory usage record. Prompts, media, responses, and credentials are not recorded.
Fields§
§id: u64Monotonic identifier within the current client session.
occurred_at: DateTime<Utc>Time at which the provider attempt finished.
operation: StringStable operation name such as infer_flash_lite or nano_banana_pro.
model: StringExact requested Gemini model identifier.
service_tier: ServiceTierRequested service tier.
succeeded: boolWhether the provider interaction produced a usable response.
provider_request_id: Option<String>Gemini interaction identifier when the provider supplied one.
failure_kind: Option<String>Local failure class without raw provider or request content.
usage: TokenUsageProvider-reported token and grounding usage.
cost: CostBreakdownLocally calculated cost at the crate’s compiled pricing version.
Trait Implementations§
Source§impl Clone for UsageRecord
impl Clone for UsageRecord
Source§fn clone(&self) -> UsageRecord
fn clone(&self) -> UsageRecord
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for UsageRecord
impl Debug for UsageRecord
impl Eq for UsageRecord
Source§impl PartialEq for UsageRecord
impl PartialEq for UsageRecord
impl StructuralPartialEq for UsageRecord
Auto Trait Implementations§
impl Freeze for UsageRecord
impl RefUnwindSafe for UsageRecord
impl Send for UsageRecord
impl Sync for UsageRecord
impl Unpin for UsageRecord
impl UnsafeUnpin for UsageRecord
impl UnwindSafe for UsageRecord
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