pub struct CodexQuotaSnapshot {Show 14 fields
pub source: QuotaSource,
pub fetched_at: i64,
pub plan_type: Option<String>,
pub primary: Option<QuotaWindow>,
pub secondary: Option<QuotaWindow>,
pub credits_balance: Option<String>,
pub has_credits: Option<bool>,
pub unlimited: Option<bool>,
pub reset_credits_available: Option<i64>,
pub reset_credit_expirations: Option<Vec<Option<i64>>>,
pub approx_messages: Option<(i64, i64)>,
pub spend_limit: Option<f64>,
pub limit_reached: Option<bool>,
pub needs_login: bool,
}Expand description
Normalized Codex quota snapshot, shared via Arc<Mutex> and persisted to
~/.vct/codex_usage.json.
Fields§
§source: QuotaSourceWhich source produced this snapshot.
fetched_at: i64Unix seconds when this snapshot was produced.
plan_type: Option<String>Plan tier, e.g. “plus”.
primary: Option<QuotaWindow>5-hour window.
secondary: Option<QuotaWindow>Weekly window.
credits_balance: Option<String>Credit balance (string, matching the API’s "0").
has_credits: Option<bool>Whether the account has purchasable credits enabled.
unlimited: Option<bool>Whether usage is unlimited.
reset_credits_available: Option<i64>Number of rate-limit reset credits available.
reset_credit_expirations: Option<Vec<Option<i64>>>Expiry times for fetched available reset-credit details. The outer
None means details were unavailable; an inner None never expires.
The backend may cap this list, so its length is not the total count.
approx_messages: Option<(i64, i64)>Approximate [low, high] messages the remaining credits still buy.
spend_limit: Option<f64>Configured spend cap, when set.
limit_reached: Option<bool>Whether a rate limit (or credit / spend cap) has been reached.
needs_login: boolToken present but unusable (refresh failed / 401); the panel shows a
codex auth login hint alongside any session-fallback data.
Trait Implementations§
Source§impl Clone for CodexQuotaSnapshot
impl Clone for CodexQuotaSnapshot
Source§fn clone(&self) -> CodexQuotaSnapshot
fn clone(&self) -> CodexQuotaSnapshot
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CodexQuotaSnapshot
impl Debug for CodexQuotaSnapshot
Source§impl Default for CodexQuotaSnapshot
impl Default for CodexQuotaSnapshot
Source§fn default() -> CodexQuotaSnapshot
fn default() -> CodexQuotaSnapshot
Source§impl<'de> Deserialize<'de> for CodexQuotaSnapshot
impl<'de> Deserialize<'de> for CodexQuotaSnapshot
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>,
Source§impl QuotaSnapshot for CodexQuotaSnapshot
impl QuotaSnapshot for CodexQuotaSnapshot
Source§fn fetched_at(&self) -> i64
fn fetched_at(&self) -> i64
Source§fn is_present(&self) -> bool
fn is_present(&self) -> bool
Source§fn set_needs_login(&mut self, value: bool)
fn set_needs_login(&mut self, value: bool)
needs_login flag without touching the data.Auto Trait Implementations§
impl Freeze for CodexQuotaSnapshot
impl RefUnwindSafe for CodexQuotaSnapshot
impl Send for CodexQuotaSnapshot
impl Sync for CodexQuotaSnapshot
impl Unpin for CodexQuotaSnapshot
impl UnsafeUnpin for CodexQuotaSnapshot
impl UnwindSafe for CodexQuotaSnapshot
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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>
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>
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