kvarn::comprash

Struct CompressedResponse

source
pub struct CompressedResponse { /* private fields */ }
Expand description

A response with a lazily compressed body.

The compressed body is cached. It therefore uses unsafe to mutate the Options containing the compressed data. This should be fine; we only write once, if the value is None.

Implementations§

source§

impl CompressedResponse

source

pub fn get_identity(&self) -> &Response<Bytes>

Gets the response with an uncompressed body.

source

pub async fn clone_preferred<T>( &self, request: &Request<T>, regular_options: &CompressionOptions, cached_options: &CompressionOptions, do_cache: