pub trait KeyExtractor: Clone {
type Key: Display;
// Required method
fn extract<T>(
&self,
request: &Request<T>,
) -> Result<Self::Key, RateLimitError>;
}Expand description
Extract a client key synchronously from a request.
A Rate Limiter owns one extractor. Normalize client identity once at this request boundary and return the resulting displayable key; do not chain multiple extractors inside the middleware.
Required Associated Types§
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".