pub trait KeyExtractor: Send + Sync {
// Required method
fn extract_key(&self, req: &Request) -> Option<String>;
}Expand description
Extracts a rate limit key from a request.
Different extractors allow rate limiting by different criteria: IP address, API key header, path, or custom logic.
Required Methods§
Sourcefn extract_key(&self, req: &Request) -> Option<String>
fn extract_key(&self, req: &Request) -> Option<String>
Extract the key string from the request.
Returns None if no key can be extracted (request is not rate-limited).