pub enum Compression {
None,
Zstd {
level: i32,
},
Lz4,
}Expand description
Compression applied to the snapshot payload on save (v0.4+).
Zstd and Lz4 are gated behind the zstd / lz4 cargo features.
Selecting a scheme whose feature is not compiled in returns
crate::PersistError::Unsupported at crate::PersistedIndex
construction — never a panic or a silent fallback. Compression applies
only to snapshots; the WAL is always stored uncompressed.
§Examples
use iqdb_persist::Compression;
let none = Compression::None;
let zstd = Compression::Zstd { level: 3 };
let lz4 = Compression::Lz4;
let _ = (none, zstd, lz4);Variants§
None
No compression — the payload is stored verbatim. Always available.
Zstd
Zstandard compression at the given level (requires the zstd
feature). Best ratio; level must be in 1..=22.
Lz4
LZ4 compression (requires the lz4 feature). Fastest; lower ratio.
Trait Implementations§
Source§impl Clone for Compression
impl Clone for Compression
Source§fn clone(&self) -> Compression
fn clone(&self) -> Compression
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for Compression
Source§impl Debug for Compression
impl Debug for Compression
Source§impl<'de> Deserialize<'de> for Compression
impl<'de> Deserialize<'de> for Compression
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
impl Eq for Compression
Source§impl PartialEq for Compression
impl PartialEq for Compression
Source§fn eq(&self, other: &Compression) -> bool
fn eq(&self, other: &Compression) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for Compression
impl Serialize for Compression
impl StructuralPartialEq for Compression
Auto Trait Implementations§
impl Freeze for Compression
impl RefUnwindSafe for Compression
impl Send for Compression
impl Sync for Compression
impl Unpin for Compression
impl UnsafeUnpin for Compression
impl UnwindSafe for Compression
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