pub enum CompressionBody<B> {
Compressed {
inner: B,
state: CompressedBody,
},
Passthrough {
inner: B,
},
}Expand description
A response body that may be compressed.
This type wraps an inner body and either compresses it using the specified codec or passes it through unchanged.
Variants§
Compressed
Compressed body with encoder.
Passthrough
Passthrough body without compression.
Fields
§
inner: BImplementations§
Source§impl<B> CompressionBody<B>
impl<B> CompressionBody<B>
Sourcepub fn compressed(inner: B, codec: Codec, always_flush: bool) -> Self
pub fn compressed(inner: B, codec: Codec, always_flush: bool) -> Self
Creates a compressed body with the given codec.
Sourcepub fn passthrough(inner: B) -> Self
pub fn passthrough(inner: B) -> Self
Creates a passthrough body without compression.