#[non_exhaustive]pub enum Compression {
None,
Lz4,
Lz4Hc(i32),
Zstd(i32),
}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
None
Disables any compression. Used by default if no compression feature is enabled.
Lz4
lz4 only.Uses LZ4 codec to (de)compress.
Used by default if the lz4 feature is enabled.
Lz4Hc(i32)
use Compression::Lz4 instead
lz4 only.Uses LZ4HC codec to compress and LZ4 to decompress.
High compression levels are useful in networks with low bandwidth.
Affects only INSERTs, because others are compressed by the server.
Possible levels: [1, 12]. Recommended level range: [4, 9].
Deprecated: lz4_flex doesn’t support HC mode yet: lz4_flex#165.
Zstd(i32)
zstd only.Uses ZSTD codec to (de)compress.
Used by default if the zstd feature is enabled and lz4 is not.
The i32 parameter specifies the compression level.
Use Compression::zstd() for the default level.
Note: Extremely high compression levels (e.g. above 19) are very CPU-intensive and likely unsuitable for real-time networked applications. They can also block the async executor for a significant amount of time. Prefer moderate levels for online usage.
Implementations§
Source§impl Compression
impl Compression
Trait Implementations§
Source§impl Clone for Compression
impl Clone for Compression
Source§fn clone(&self) -> Compression
fn clone(&self) -> Compression
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more