Skip to main content

SharedBrotliDecoder

Trait SharedBrotliDecoder 

Source
pub trait SharedBrotliDecoder {
    // Required method
    fn decode(
        &self,
        encoded: &[u8],
        shared_dictionary: Option<&[u8]>,
        max_uncompressed_length: usize,
    ) -> Result<Vec<u8>, DecodeError>;
}
Expand description

A Shared Brotli Decoder.

Shared brotli (https://datatracker.ietf.org/doc/draft-vandevenne-shared-brotli-format/) is an extension of brotli to allow the decompression to include a shared dictionary.

Required Methods§

Source

fn decode( &self, encoded: &[u8], shared_dictionary: Option<&[u8]>, max_uncompressed_length: usize, ) -> Result<Vec<u8>, DecodeError>

Decodes shared brotli encoded data using the optional shared dictionary.

The shared dictionary is a raw LZ77 style dictionary, see: https://datatracker.ietf.org/doc/html/draft-vandevenne-shared-brotli-format#section-3.2

Will fail if the decoded result will be greater than max_uncompressed_length. Any excess data in encoded after the encoded stream finishes is also considered an error.

Trait Implementations§

Source§

impl SharedBrotliDecoder for Box<dyn SharedBrotliDecoder>

Source§

fn decode( &self, encoded: &[u8], shared_dictionary: Option<&[u8]>, max_uncompressed_length: usize, ) -> Result<Vec<u8>, DecodeError>

Decodes shared brotli encoded data using the optional shared dictionary. Read more

Implementations on Foreign Types§

Source§

impl SharedBrotliDecoder for Box<dyn SharedBrotliDecoder>

Source§

fn decode( &self, encoded: &[u8], shared_dictionary: Option<&[u8]>, max_uncompressed_length: usize, ) -> Result<Vec<u8>, DecodeError>

Implementors§