Skip to main content

BodyExtractor

Trait BodyExtractor 

Source
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:

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§

Source

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.

Implementors§

Source§

impl<E> BodyExtractor for E
where E: Extractor,