Function check_rate_limit

Source
pub fn check_rate_limit(key: &str) -> Result<Rate, RemoteStateError>
Expand description

Checks a rate limit, returning the number of attempts so far and the expiration time.

In order for this function to succeed, a plugin’s configuration must explicitly declare a permission grant for the prefix of the key being requested. This function will panic if permission has not been granted.

See increment_rate_limit.

§Arguments

  • key - The key name corresponding to the state counter.