pub struct Quota {
pub agent: String,
pub windows: Vec<QuotaWindow>,
pub reached: bool,
pub warning: bool,
pub updated_ms: u64,
}Expand description
Current quota status for an agent account (reported by agent itself, not estimated by ertangle).
Fields§
§agent: StringAgent kind ID, e.g. claude, codex.
windows: Vec<QuotaWindow>§reached: boolQuota limit reached / rate limited.
warning: boolAgent reported approaching limit warning (e.g. Claude allowed_warning), still usable.
updated_ms: u64Implementations§
Source§impl Quota
impl Quota
Sourcepub fn summary(&self, now_ms: u64) -> String
pub fn summary(&self, now_ms: u64) -> String
One-line summary: claude 5h 39% (reset 1h20m) 7d 22%. Windows past reset time show reset.
Sourcepub fn is_reached(&self, now_ms: u64) -> bool
pub fn is_reached(&self, now_ms: u64) -> bool
Whether this agent’s quota is currently reached/exhausted at now_ms.
If there are no windows (e.g. error-only rate limit without window timestamps),
falls back to self.reached. Otherwise, returns true if any active live window
has used_percent >= 100.0, OR if self.reached is true and no active window
has reset yet.
Sourcepub fn max_used_live(&self, now_ms: u64) -> f32
pub fn max_used_live(&self, now_ms: u64) -> f32
Tightest usage among windows that have not reset yet (percentage).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Quota
impl<'de> Deserialize<'de> for Quota
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
impl StructuralPartialEq for Quota
Auto Trait Implementations§
impl Forget for Quota
impl Freeze for Quota
impl Move for Quota
impl RefUnwindSafe for Quota
impl Send for Quota
impl Sync for Quota
impl Unpin for Quota
impl UnsafeUnpin for Quota
impl UnwindSafe for Quota
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