Trait gzp::FormatSpec[][src]

pub trait FormatSpec: Clone + Copy + Debug + Send + Sync + 'static {
    type C: Check + Send + 'static;
    fn new() -> Self;
fn needs_dict(&self) -> bool;
fn encode(
        &self,
        input: &[u8],
        compression_level: Compression,
        dict: Option<&Bytes>,
        is_last: bool
    ) -> Result<Vec<u8>, GzpError>;
fn header(&self, compression_leval: Compression) -> Vec<u8>;
fn footer(&self, check: &Self::C) -> Vec<u8>; fn create_check() -> Self::C { ... }
fn to_bytes(&self, pairs: &[Pair]) -> Vec<u8> { ... } }
Expand description

Defines how to write the header and footer for each format.

Associated Types

The Check type for this format.

Required methods

Create a new instance of this format spec

Whether or not this format should try to use a dictionary.

How to deflate bytes for this format. Returns deflated bytes.

Generate a generic header for the given format.

Generate a genric footer for the format.

Provided methods

Create a check value for this format that implements Check

Convert a list of Pair into bytes.

Implementors