pub trait BodyExtractor: Sized {
// Required method
fn body(self, extraction: BodyExtraction) -> Body<Self>;
}Expand description
Extension trait for adding body extraction to an extractor chain.
§For Callers
Chain this to extract cache key parts from request bodies. Choose an extraction mode based on your needs:
BodyExtraction::Hashfor opaque body identificationBodyExtraction::Jqfor JSON content extractionBodyExtraction::Regexfor pattern-based extraction
Important: Body extraction buffers the entire body into memory.
The body is returned as BufferedBody::Complete after extraction.
§For Implementors
This trait is automatically implemented for all Extractor
types. You don’t need to implement it manually.
Required Methods§
Sourcefn body(self, extraction: BodyExtraction) -> Body<Self>
fn body(self, extraction: BodyExtraction) -> Body<Self>
Adds body extraction with the specified mode.
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.