Skip to main content

Module ratelimit

Module ratelimit 

Source
Expand description

Rate limit metadata types.

RateLimitInfo carries the structured data normally surfaced through X-RateLimit-* HTTP response headers, making it easy to include quota information in both successful responses and 429 error bodies.

§Example

use api_bones::ratelimit::RateLimitInfo;

let info = RateLimitInfo::new(100, 0, 1_700_000_000).retry_after(60);
assert!(info.is_exceeded());
assert_eq!(info.retry_after, Some(60));

Structs§

RateLimitInfo
Structured rate-limit metadata matching X-RateLimit-* headers.