pub enum CompressionAlgorithm {
None,
Lz4,
Snappy,
Deflate,
Zstd,
}Expand description
Compression algorithms supported
Variants§
None
No compression
Lz4
LZ4 compression (fast)
Snappy
Snappy compression (balanced)
Deflate
Deflate compression (high ratio)
Zstd
Zstd compression (high efficiency)
Implementations§
Source§impl CompressionAlgorithm
impl CompressionAlgorithm
Sourcepub fn parse(s: &str) -> Result<Self>
pub fn parse(s: &str) -> Result<Self>
Fallible parse of a compressor name (issue #1001).
This is the path the SSTable open / CompressionInfo.db flow MUST use: an
unrecognized name produces an explicit UnsupportedFormat error (including the
exact offending string) rather than silently falling back to uncompressed.
No content-based guessing is performed (no-heuristics mandate, issue #28).
Trait Implementations§
Source§impl Clone for CompressionAlgorithm
impl Clone for CompressionAlgorithm
Source§fn clone(&self) -> CompressionAlgorithm
fn clone(&self) -> CompressionAlgorithm
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for CompressionAlgorithm
Source§impl Debug for CompressionAlgorithm
impl Debug for CompressionAlgorithm
Source§impl Default for CompressionAlgorithm
impl Default for CompressionAlgorithm
Source§fn default() -> CompressionAlgorithm
fn default() -> CompressionAlgorithm
Source§impl<'de> Deserialize<'de> for CompressionAlgorithm
impl<'de> Deserialize<'de> for CompressionAlgorithm
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>,
Source§impl From<&str> for CompressionAlgorithm
impl From<&str> for CompressionAlgorithm
Source§fn from(s: &str) -> Self
fn from(s: &str) -> Self
Infallible best-effort mapping. Unrecognized names map to None.
WARNING: this MUST NOT be used on the SSTable read path — an unknown name here
is indistinguishable from genuinely-disabled compression. Use the fallible
CompressionAlgorithm::parse for any path that opens real CompressionInfo.db
metadata (issue #1001). This From is retained only for the legacy header
(SSTableHeader.compression.algorithm) path, which guards with an explicit
!= "NONE" check before conversion and re-validates the resulting variant.