pub struct UsageLimitInfo {
pub limit_type: String,
pub api: String,
pub current: f64,
pub limit: f64,
pub tier: String,
pub retry_after_seconds: Option<i64>,
pub upgrade_url: String,
}Expand description
Usage limit error details.
Raised when an organization’s rate limit is exceeded.
Fields§
§limit_type: StringType of limit exceeded (e.g., “inference_tokens_per_day”)
api: StringAPI that hit the limit (e.g., “inference”, “verifiers”, “prompt_opt”)
current: f64Current usage value
limit: f64The limit value
tier: StringOrganization’s tier (e.g., “free”, “starter”, “growth”)
retry_after_seconds: Option<i64>Seconds until the limit resets (if available)
upgrade_url: StringURL to upgrade tier
Implementations§
Source§impl UsageLimitInfo
impl UsageLimitInfo
Sourcepub fn from_http_429(api: &str, detail: &HttpErrorDetail) -> Self
pub fn from_http_429(api: &str, detail: &HttpErrorDetail) -> Self
Build a usage limit payload from an HTTP 429 response detail.
This parser supports FastAPI-style payloads where fields may be nested
under detail, and gracefully handles string-only detail values.
Trait Implementations§
Source§impl Clone for UsageLimitInfo
impl Clone for UsageLimitInfo
Source§fn clone(&self) -> UsageLimitInfo
fn clone(&self) -> UsageLimitInfo
Returns a duplicate of the value. Read more
1.0.0 · 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 UsageLimitInfo
impl Debug for UsageLimitInfo
Source§impl Default for UsageLimitInfo
impl Default for UsageLimitInfo
Source§impl<'de> Deserialize<'de> for UsageLimitInfo
impl<'de> Deserialize<'de> for UsageLimitInfo
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 Display for UsageLimitInfo
impl Display for UsageLimitInfo
Auto Trait Implementations§
impl Freeze for UsageLimitInfo
impl RefUnwindSafe for UsageLimitInfo
impl Send for UsageLimitInfo
impl Sync for UsageLimitInfo
impl Unpin for UsageLimitInfo
impl UnwindSafe for UsageLimitInfo
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> 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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::RequestSource§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.