#[non_exhaustive]pub struct AccountUsage {
pub account_kind: Option<String>,
pub plan: Option<String>,
pub email: Option<String>,
pub windows: Vec<UsageWindow>,
pub credits: Option<Credits>,
pub lifetime: Option<Lifetime>,
pub daily: Vec<DailyUsage>,
pub spend_control_reached: Option<bool>,
}Expand description
What an account has spent and what it has left.
Every field is optional or empty-able: this is assembled from whatever the agent reports, and absent means “it did not say”, never zero.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.account_kind: Option<String>How the account authenticates, e.g. chatgpt.
plan: Option<String>The plan name the provider reports, e.g. plus.
email: Option<String>Email on the account, where the agent reports one.
windows: Vec<UsageWindow>Every quota window the provider is tracking, most constraining first as the provider ordered them.
credits: Option<Credits>Pay-as-you-go balance, where the plan has one.
lifetime: Option<Lifetime>All-time counters, where the agent keeps them.
daily: Vec<DailyUsage>Per-day token totals, oldest first.
spend_control_reached: Option<bool>Whether spend controls have already stopped this account.
Trait Implementations§
Source§impl Clone for AccountUsage
impl Clone for AccountUsage
Source§fn clone(&self) -> AccountUsage
fn clone(&self) -> AccountUsage
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 AccountUsage
impl Debug for AccountUsage
Source§impl Default for AccountUsage
impl Default for AccountUsage
Source§fn default() -> AccountUsage
fn default() -> AccountUsage
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for AccountUsage
impl<'de> Deserialize<'de> for AccountUsage
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
Source§impl PartialEq for AccountUsage
impl PartialEq for AccountUsage
Source§impl Serialize for AccountUsage
impl Serialize for AccountUsage
impl StructuralPartialEq for AccountUsage
Auto Trait Implementations§
impl Freeze for AccountUsage
impl RefUnwindSafe for AccountUsage
impl Send for AccountUsage
impl Sync for AccountUsage
impl Unpin for AccountUsage
impl UnsafeUnpin for AccountUsage
impl UnwindSafe for AccountUsage
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