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§
Required Methods§
Sourcefn with_config(config: Self::Config) -> Self
fn with_config(config: Self::Config) -> Self
Create a new instance with the given configuration
Sourcefn add_pattern(&mut self, pattern: Self::Pattern) -> Result<(), Self::Error>
fn add_pattern(&mut self, pattern: Self::Pattern) -> Result<(), Self::Error>
Add a pattern to the compression dictionary
Sourcefn remove_pattern(&mut self, pattern_id: &str) -> Result<(), Self::Error>
fn remove_pattern(&mut self, pattern_id: &str) -> Result<(), Self::Error>
Remove a pattern from the compression dictionary
Sourcefn pattern_info(&self) -> HashMap<String, PatternInfo>
fn pattern_info(&self) -> HashMap<String, PatternInfo>
Get information about registered patterns
Sourcefn optimize_patterns(&mut self) -> Result<(), Self::Error>
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".