Skip to main content

SequenceProducer

Trait SequenceProducer 

Source
pub trait SequenceProducer {
    // Required method
    fn produce(
        &mut self,
        block: &[u8],
        window_size: u64,
        out: &mut Vec<ExternalSequence>,
    ) -> Result<(), SequenceProducerError>;
}
Expand description

A parser asked for each block in place of the built-in match finder (C ZSTD_registerSequenceProducer). Its parse covers the block alone, with no history before it.

Required Methods§

Source

fn produce( &mut self, block: &[u8], window_size: u64, out: &mut Vec<ExternalSequence>, ) -> Result<(), SequenceProducerError>

Append a parse of block to out: matches only within block, at most window_size back, ending with a sequence of no match, or one whose match reaches the end.

§Errors

SequenceProducerError when there is no parse; the encoder then falls back to its own match finder or fails the frame, as configured.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§