maybe_compress

Function maybe_compress 

Source
pub fn maybe_compress(
    data: &[u8],
    kind: &CompressionKind,
    threshold_bytes: usize,
) -> Result<(Vec<u8>, bool)>
Expand description

Compress data if it meets the configured threshold, otherwise return it unchanged. Returns the output bytes and a flag indicating whether compression was applied.