Skip to main content

PatternCompressionStrategy

Trait PatternCompressionStrategy 

Source
pub trait PatternCompressionStrategy: CompressionStrategy {
    type Pattern: Clone + Send + Sync;
    type Config: Clone + Send + Sync;

    // Required methods
    fn with_config(config: Self::Config) -> Self;
    fn add_pattern(&mut self, pattern: Self::Pattern) -> Result<(), Self::Error>;
    fn remove_pattern(&mut self, pattern_id: &str) -> Result<(), Self::Error>;
    fn pattern_info(&self) -> HashMap<String, PatternInfo>;
    fn optimize_patterns(&mut self) -> Result<(), Self::Error>;
}
Expand description

A trait for pattern-based compression strategies

Required Associated Types§

Source

type Pattern: Clone + Send + Sync

The type representing a pattern

Source

type Config: Clone + Send + Sync

The type representing pattern configuration

Required Methods§

Source

fn with_config(config: Self::Config) -> Self

Create a new instance with the given configuration

Source

fn add_pattern(&mut self, pattern: Self::Pattern) -> Result<(), Self::Error>

Add a pattern to the compression dictionary

Source

fn remove_pattern(&mut self, pattern_id: &str) -> Result<(), Self::Error>

Remove a pattern from the compression dictionary

Source

fn pattern_info(&self) -> HashMap<String, PatternInfo>

Get information about registered patterns

Source

fn optimize_patterns(&mut self) -> Result<(), Self::Error>

Optimize pattern dictionary based on usage statistics

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§