pub struct RateLimitSnapshot {
pub graphql: Option<RateLimitResource>,
pub core: Option<RateLimitResource>,
pub search: Option<RateLimitResource>,
}Expand description
A parsed gh api rate_limit snapshot: the resources this monitor surfaces.
Every field is optional and skipped when absent, so the JSON on the daemon’s
status payload carries only what gh actually returned (the daemon’s
forward-compat contract). In practice graphql and core are always present.
Fields§
§graphql: Option<RateLimitResource>The GraphQL API budget — what the PR-badge poller spends.
core: Option<RateLimitResource>The REST (core) API budget.
search: Option<RateLimitResource>The search API budget.
Implementations§
Source§impl RateLimitSnapshot
impl RateLimitSnapshot
Sourcepub fn max_percent(&self) -> f64
pub fn max_percent(&self) -> f64
The highest used-percentage across present resources, or 0.0 when empty.
Sourcepub fn over_warn(&self) -> bool
pub fn over_warn(&self) -> bool
Whether any present resource is at or above WARN_PERCENT.
Sourcepub fn summary_line(&self) -> String
pub fn summary_line(&self) -> String
The one-line summary for daemon status, e.g.
graphql 82% (4100/5000, resets 06:50Z) · core 3% (27/1000), prefixed with
⚠ when any resource is over the warn threshold. Empty when no resource is
present (the caller then prints nothing).
Sourcepub fn tray_label(&self) -> String
pub fn tray_label(&self) -> String
The compact tray label, e.g. github: graphql 82% · core 3%, with a
trailing ⚠ when over the warn threshold. Empty when no resource is present.
Trait Implementations§
Source§impl Clone for RateLimitSnapshot
impl Clone for RateLimitSnapshot
Source§fn clone(&self) -> RateLimitSnapshot
fn clone(&self) -> RateLimitSnapshot
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more