pub trait Extractor {
type Subject;
// Required method
fn get<'life0, 'async_trait>(
&'life0 self,
subject: Self::Subject,
) -> Pin<Box<dyn Future<Output = KeyParts<Self::Subject>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Trait for extracting cache key components from a subject.
Extractors are the mechanism for building cache keys from requests. They are protocol-agnostic - the same trait works for HTTP requests, gRPC messages, or any other protocol type.
§Type Parameters
The Subject associated type defines what this extractor processes.
Typically this is a request type from which cache key components
are extracted.
§Ownership
The get method takes ownership of the subject and returns it wrapped
in KeyParts along with the extracted key components. This allows
extractors to be chained without cloning.
§Blanket Implementations
This trait is implemented for:
&TwhereT: ExtractorBox<T>whereT: ExtractorArc<T>whereT: Extractor
Required Associated Types§
Required Methods§
Sourcefn get<'life0, 'async_trait>(
&'life0 self,
subject: Self::Subject,
) -> Pin<Box<dyn Future<Output = KeyParts<Self::Subject>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get<'life0, 'async_trait>(
&'life0 self,
subject: Self::Subject,
) -> Pin<Box<dyn Future<Output = KeyParts<Self::Subject>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Extract cache key components from the subject.
Returns a KeyParts containing the subject and accumulated key parts.