pub trait HeaderCompatibleOutput {
    // Required methods
    fn limit(&self) -> u64;
    fn remaining(&self) -> u64;
    fn seconds_until_reset(&self) -> u64;
}
Expand description

A trait that a Backend::Output should implement in order to use the RateLimiterBuilder::add_headers function.

Required Methods§

source

fn limit(&self) -> u64

Value for the x-ratelimit-limit header.

source

fn remaining(&self) -> u64

Value for the x-ratelimit-remaining header.

source

fn seconds_until_reset(&self) -> u64

Value for the x-ratelimit-reset and retry-at headers.

This should be the number of seconds from now until the limit resets.
If the limit has already reset this should return 0.

Implementors§