Rate-limit accounting reported by the Gaiia API.
Limits are query-cost based, not request based: each API key has a point
bucket, every operation removes its calculated cost, and points refill over
time. Every response reports the bucket state in x-rate-limit-* headers,
and a rejected operation additionally reports it in the extensions of a
RATE_LIMITED GraphQL error.
Read remaining and retry_at to throttle before being rejected — the
documented limits are not fixed, so they cannot be hardcoded by a client.
Both Gaiia.Response and Gaiia.Error carry this struct when the API
reported it.
Summary
Functions
Build a rate-limit struct from the extensions of a RATE_LIMITED
GraphQL error.
Build a rate-limit struct from response headers.
Types
Functions
Build a rate-limit struct from the extensions of a RATE_LIMITED
GraphQL error.
Such an operation was rejected, so allowed is false.
Build a rate-limit struct from response headers.
Returns nil when the response carries no x-rate-limit-* header, so
callers can distinguish "not reported" from "reported as zero".