pub enum Tier {
Standard,
Copper,
Bronze,
Silver,
Gold,
Platinum,
Diamond,
Elite,
}Expand description
An account’s volume tier, which sets both buckets’ rate and capacity.
Tier is assigned upstream from 30-day volume. Clients cannot compute it, so
it is discovered from the Poly-RateLimit-Tier response header; until one is
seen, Tier::Standard is assumed because it is the tightest.
Variants§
Standard
No volume requirement.
Copper
$30,000+ 30-day volume.
Bronze
$50,000+ 30-day volume.
Silver
$100,000+ 30-day volume.
Gold
$500,000+ 30-day volume.
Platinum
$2.5M+ 30-day volume.
Diamond
$5M+ 30-day volume.
Elite
$10M+ 30-day volume.
Implementations§
Source§impl Tier
impl Tier
Sourcepub fn rate(self, bucket: TradingBucket) -> u32
pub fn rate(self, bucket: TradingBucket) -> u32
Sustained refill rate for bucket, in tokens per second.
Sourcepub fn burst(self, bucket: TradingBucket) -> u32
pub fn burst(self, bucket: TradingBucket) -> u32
Burst capacity for bucket — the most tokens it ever holds.
A request costing more than this can never be satisfied, however long the caller waits.
Sourcepub fn from_header(value: &str) -> Option<Self>
pub fn from_header(value: &str) -> Option<Self>
Parse the value of a Poly-RateLimit-Tier header.
Matching is case-insensitive; an unrecognised tier returns None rather
than guessing, so an upstream addition cannot silently widen a bucket.