pub trait KeyResolver: Clone {
type ErrorBody;
// Required method
fn key<T>(&self, req: &Request<T>) -> Result<Key, Response<Self::ErrorBody>>;
}Expand description
Resolves a Redis key for each incoming request.
Requests with the same key are rate limited together.
Required Associated Types§
Sourcetype ErrorBody
type ErrorBody
The type of the response body when KeyResolver::key fails.
Must match the type of the response body of the underlying service.
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.