pub struct UsageResponse {
pub plan_type: Option<String>,
pub rate_limit: Option<RateLimit>,
pub code_review_rate_limit: Option<RateLimit>,
pub credits: Option<CreditsBlock>,
pub rate_limit_reset_credits: Option<ResetCreditsBlock>,
pub additional_rate_limits: Vec<AdditionalRateLimit>,
pub model_usage: BTreeMap<String, ModelUsage>,
}Fields§
§plan_type: Option<String>§rate_limit: Option<RateLimit>§code_review_rate_limit: Option<RateLimit>§credits: Option<CreditsBlock>§rate_limit_reset_credits: Option<ResetCreditsBlock>§additional_rate_limits: Vec<AdditionalRateLimit>Named limits alongside the main one — a reserved pool, a
model-specific allowance. Each carries its own windows and can be the
binding constraint while rate_limit still reads low, which is
precisely when a user needs to see it.
Null from the API means “none” (observed 2026-09-05: OpenAI returns
"additional_rate_limits": null for accounts with no extra limits).
model_usage: BTreeMap<String, ModelUsage>Per-model availability. available: false is what “Selected model is
at capacity” looks like in the data — a dispatch-time refusal, not a
quota, so no percentage anywhere else reflects it.
Implementations§
Source§impl UsageResponse
impl UsageResponse
pub fn into_snapshot(self, plan_hint: Option<&str>) -> AppResult<OpenAiSnapshot>
Trait Implementations§
Source§impl Clone for UsageResponse
impl Clone for UsageResponse
Source§fn clone(&self) -> UsageResponse
fn clone(&self) -> UsageResponse
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 UsageResponse
impl Debug for UsageResponse
Source§impl Default for UsageResponse
impl Default for UsageResponse
Source§fn default() -> UsageResponse
fn default() -> UsageResponse
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for UsageResponsewhere
UsageResponse: Default,
impl<'de> Deserialize<'de> for UsageResponsewhere
UsageResponse: Default,
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 UsageResponse
impl RefUnwindSafe for UsageResponse
impl Send for UsageResponse
impl Sync for UsageResponse
impl Unpin for UsageResponse
impl UnsafeUnpin for UsageResponse
impl UnwindSafe for UsageResponse
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,
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> ⓘ
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