pub struct ZstdCompressionEngine { /* private fields */ }Expand description
Compression engine for frozen memory tier using zstd Optimized for 5:1 compression ratio target with fast decompression
Implementations§
Source§impl ZstdCompressionEngine
impl ZstdCompressionEngine
Sourcepub fn with_level(level: i32) -> Self
pub fn with_level(level: i32) -> Self
Create compression engine with custom level
Sourcepub fn compress_memory_data(
&self,
content: &str,
metadata: &Value,
) -> Result<CompressionResult>
pub fn compress_memory_data( &self, content: &str, metadata: &Value, ) -> Result<CompressionResult>
Compress memory content and metadata into a single compressed blob Returns compressed bytes and compression metrics
Sourcepub fn decompress_memory_data(
&self,
compressed_data: &[u8],
) -> Result<MemoryData>
pub fn decompress_memory_data( &self, compressed_data: &[u8], ) -> Result<MemoryData>
Decompress memory data back to original content and metadata Includes integrity validation
Sourcepub fn batch_compress(
&self,
memories: Vec<(&str, &Value)>,
) -> Result<Vec<CompressionResult>>
pub fn batch_compress( &self, memories: Vec<(&str, &Value)>, ) -> Result<Vec<CompressionResult>>
Batch compress multiple memories for efficient processing
Sourcepub fn estimate_compression_ratio(&self, content: &str) -> f64
pub fn estimate_compression_ratio(&self, content: &str) -> f64
Estimate compression ratio for planning purposes
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ZstdCompressionEngine
impl RefUnwindSafe for ZstdCompressionEngine
impl Send for ZstdCompressionEngine
impl Sync for ZstdCompressionEngine
impl Unpin for ZstdCompressionEngine
impl UnwindSafe for ZstdCompressionEngine
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more