pub struct CompressionConfig {
pub enabled: bool,
pub algorithm: String,
pub min_size: usize,
pub level: u32,
pub content_types: Vec<String>,
}Expand description
Response compression configuration
Fields§
§enabled: boolEnable response compression
algorithm: StringCompression algorithm: gzip, deflate, br (brotli), zstd
min_size: usizeMinimum response size to compress (bytes)
level: u32Compression level (1-9 for gzip/deflate, 0-11 for brotli, 1-22 for zstd)
content_types: Vec<String>Content types to compress (e.g., ["application/json", "text/html"])
Trait Implementations§
Source§impl Clone for CompressionConfig
impl Clone for CompressionConfig
Source§fn clone(&self) -> CompressionConfig
fn clone(&self) -> CompressionConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CompressionConfig
impl Debug for CompressionConfig
Source§impl Default for CompressionConfig
impl Default for CompressionConfig
Source§impl<'de> Deserialize<'de> for CompressionConfigwhere
CompressionConfig: Default,
impl<'de> Deserialize<'de> for CompressionConfigwhere
CompressionConfig: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for CompressionConfig
impl RefUnwindSafe for CompressionConfig
impl Send for CompressionConfig
impl Sync for CompressionConfig
impl Unpin for CompressionConfig
impl UnsafeUnpin for CompressionConfig
impl UnwindSafe for CompressionConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more