pub struct QuotaReading {
pub resource: String,
pub limit: u64,
pub remaining: u64,
pub used: u64,
pub resets_at: DateTime<Utc>,
}Expand description
What one response — or one read of the backend’s own allowance endpoint — said about one rate-limit window of the backend.
One window, never merged. A credential may be metered by several windows of the same
resource at once — GitHub was measured answering one token from two concurrent GraphQL
windows, each with its own reset, while GET /rate_limit reported only one of them — so a
source reports each reading as the response that carried it said it, with its own
resets_at. Choosing the least of several is the caller’s.
Fields§
§resource: StringThe backend’s own name for what is metered — GitHub’s resource names (graphql,
core, search and so on), Linear’s requests and complexity.
limit: u64The whole allowance of the window.
remaining: u64What was left of it when the backend answered.
used: u64What the credential had spent of it — everything that shares the credential, not only this source.
resets_at: DateTime<Utc>When the window resets and the allowance comes back.
Trait Implementations§
Source§impl Clone for QuotaReading
impl Clone for QuotaReading
Source§impl Debug for QuotaReading
impl Debug for QuotaReading
Source§impl<'de> Deserialize<'de> for QuotaReading
impl<'de> Deserialize<'de> for QuotaReading
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>,
impl Eq for QuotaReading
Source§impl JsonSchema for QuotaReading
impl JsonSchema for QuotaReading
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more