pub struct MatchGeneratorDriver { /* private fields */ }Expand description
This is the default implementation of the Matcher trait. It allocates and reuses the buffers when possible.
Trait Implementations§
Source§impl Matcher for MatchGeneratorDriver
impl Matcher for MatchGeneratorDriver
Source§fn block_samples_match_dict(&self, block: &[u8]) -> bool
fn block_samples_match_dict(&self, block: &[u8]) -> bool
Dict-relevance gate for the raw-fast-path. Reached only when a dictionary
is active (the caller short-circuits on dict_active), so this answers
“could the dict compress this otherwise-incompressible-looking block?”.
The Simple (Fast) backend samples its dict table precisely
([FastKernelMatcher::block_samples_match_dict]); the other backends
(Dfast / Row / HashChain / BT) have their own dict structures and no cheap
probe here, so they answer CONSERVATIVELY true: without a probe they
cannot tell whether the dict compresses an incompressible-LOOKING block,
and answering false would let the raw-fast-path emit such a block raw
and miss an embedded dict segment. dictionary_segment_in_incompressible_input_is_matched
pins this for Dfast/Row/BT — the 512-byte dict run inside high-entropy
filler is matched only because these backends stay on the scan. So they
keep the blanket scan the old !dict_active gate gave them; only the
Simple/Fast backend trades it for the precise probe.
Source§fn heap_size(&self) -> usize
fn heap_size(&self) -> usize
Heap bytes this driver owns: the active backend’s tables/history, the
recycled input-buffer pool, and the primed-dictionary snapshot (a cloned
backend kept for CDict-equivalent reuse). The inline struct itself is
accounted by the owner’s size_of.
Source§fn supports_dictionary_priming(&self) -> bool
fn supports_dictionary_priming(&self) -> bool
false for custom matchers.Source§fn set_source_size_hint(&mut self, size: u64)
fn set_source_size_hint(&mut self, size: u64)
Source§fn set_dictionary_size_hint(&mut self, size: usize)
fn set_dictionary_size_hint(&mut self, size: usize)
reset.Source§fn clear_param_overrides(&mut self)
fn clear_param_overrides(&mut self)
reset. Called by
FrameCompressor::set_compression_level
so switching back to a bare level after a customized frame does not
keep the old overrides sticky. Default no-op for custom matchers.Source§fn reset(&mut self, level: CompressionLevel)
fn reset(&mut self, level: CompressionLevel)
Source§fn dictionary_is_resident(&self) -> bool
fn dictionary_is_resident(&self) -> bool
reset re-borrowed a resident
attach-mode dictionary (kept the dict bytes + cached index in place).
When true the caller MUST skip Self::prime_with_dictionary and only
reapply the offset history via Self::reapply_resident_dictionary.Source§fn reapply_resident_dictionary(&mut self, offset_hist: [u32; 3])
fn reapply_resident_dictionary(&mut self, offset_hist: [u32; 3])
Source§fn prime_with_dictionary(&mut self, dict_content: &[u8], offset_hist: [u32; 3])
fn prime_with_dictionary(&mut self, dict_content: &[u8], offset_hist: [u32; 3])
Source§fn restore_primed_dictionary(&mut self, level: CompressionLevel) -> bool
fn restore_primed_dictionary(&mut self, level: CompressionLevel) -> bool
Self::capture_primed_dictionary
at the SAME level (a table copy) instead of re-running
Self::prime_with_dictionary (which re-hashes every dictionary
position). Returns true when a matching snapshot was restored;
false (the default) means the caller must prime then capture.Source§fn capture_primed_dictionary(&mut self, level: CompressionLevel)
fn capture_primed_dictionary(&mut self, level: CompressionLevel)
Self::restore_primed_dictionary it. Default no-op.