pub struct RateWindow {
pub used_percent: f64,
pub raw_used_percent: Option<f64>,
pub resets_at: Option<String>,
pub window_minutes: Option<i64>,
pub used_count: Option<f64>,
pub total_count: Option<f64>,
}Expand description
One rate-limit window: how much of a quota pool is spent and when it resets.
Fields§
§used_percent: f640..100 percent of the window’s quota consumed. This is the EFFECTIVE
number consumers pace on: when banked-reset relaxation applies it is
zeroed, and the provider-reported percent moves to raw_used_percent.
raw_used_percent: Option<f64>The provider-reported percent when used_percent has been relaxed to
an effective value (banked resets guarantee the window resets before
the wall). Present only on relaxed windows; human-facing UIs should
display this truth alongside the effective number.
resets_at: Option<String>ISO 8601 / RFC 3339 timestamp when the window resets. Omitted when the provider reports no reset (e.g. an idle session window with nothing pending) — never fabricated.
window_minutes: Option<i64>Window length in minutes. Omitted when the provider does not report one; the consumer then paces on utilization alone rather than a burn rate.
used_count: Option<f64>Absolute consumed count in the window (e.g. tokens, requests). Present only when the provider reports or derives it; human-facing UIs can show “10,336 / 40,000” alongside the percentage for richer context.
total_count: Option<f64>Absolute total cap for the window. Present alongside used_count when
the provider knows the ceiling; omitted otherwise.
Trait Implementations§
Source§impl Clone for RateWindow
impl Clone for RateWindow
Source§fn clone(&self) -> RateWindow
fn clone(&self) -> RateWindow
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more