pub trait RateLimitBackend:
Send
+ Sync
+ Debug {
// Required method
fn increment_and_get(
&self,
key: &str,
window_secs: u64,
) -> Result<u64, ServerError>;
}Available on crate feature
distributed-rate-limit only.Expand description
Required Methods§
Sourcefn increment_and_get(
&self,
key: &str,
window_secs: u64,
) -> Result<u64, ServerError>
fn increment_and_get( &self, key: &str, window_secs: u64, ) -> Result<u64, ServerError>
Increments key and returns current hit count for the active window.