Trait EncoderOrDecoderSpecialization

Source
pub trait EncoderOrDecoderSpecialization {
    const DOES_CALLER_WANT_ORIGINAL_FILE_BYTES: bool;
    const IS_DECODING_FILE: bool;

    // Required methods
    fn alloc_literal_buffer<AllocU8: Allocator<u8>>(
        &mut self,
        m8: &mut AllocU8,
        len: usize,
    ) -> AllocatedMemoryPrefix<u8, AllocU8>;
    fn get_input_command<'a, ISlice: SliceWrapper<u8>>(
        &self,
        data: &'a [Command<ISlice>],
        offset: usize,
        backing: &'a Command<ISlice>,
    ) -> &'a Command<ISlice>;
    fn get_output_command<'a, AllocU8: Allocator<u8>>(
        &self,
        data: &'a mut [Command<AllocatedMemoryPrefix<u8, AllocU8>>],
        offset: usize,
        backing: &'a mut Command<AllocatedMemoryPrefix<u8, AllocU8>>,
    ) -> &'a mut Command<AllocatedMemoryPrefix<u8, AllocU8>>;
    fn get_source_copy_command<'a, ISlice: SliceWrapper<u8>>(
        &self,
        _: &'a Command<ISlice>,
        _: &'a CopyCommand,
    ) -> &'a CopyCommand;
    fn get_source_literal_command<'a, ISlice: SliceWrapper<u8> + Default>(
        &self,
        _: &'a Command<ISlice>,
        _: &'a LiteralCommand<ISlice>,
    ) -> &'a LiteralCommand<ISlice>;
    fn get_source_dict_command<'a, ISlice: SliceWrapper<u8>>(
        &self,
        _: &'a Command<ISlice>,
        _: &'a DictCommand,
    ) -> &'a DictCommand;
    fn get_literal_byte<ISlice: SliceWrapper<u8>>(
        &self,
        in_cmd: &LiteralCommand<ISlice>,
        index: usize,
    ) -> u8;
    fn get_recoder_output<'a>(
        &'a mut self,
        passed_in_output_bytes: &'a mut [u8],
    ) -> &'a mut [u8] ;
    fn get_recoder_output_offset<'a>(
        &self,
        passed_in_output_bytes: &'a mut usize,
        backing: &'a mut usize,
    ) -> &'a mut usize;

    // Provided method
    fn adapt_cdf(&self) -> bool { ... }
}

Required Associated Constants§

Required Methods§

Source

fn alloc_literal_buffer<AllocU8: Allocator<u8>>( &mut self, m8: &mut AllocU8, len: usize, ) -> AllocatedMemoryPrefix<u8, AllocU8>

Source

fn get_input_command<'a, ISlice: SliceWrapper<u8>>( &self, data: &'a [Command<ISlice>], offset: usize, backing: &'a Command<ISlice>, ) -> &'a Command<ISlice>

Source

fn get_output_command<'a, AllocU8: Allocator<u8>>( &self, data: &'a mut [Command<AllocatedMemoryPrefix<u8, AllocU8>>], offset: usize, backing: &'a mut Command<AllocatedMemoryPrefix<u8, AllocU8>>, ) -> &'a mut Command<AllocatedMemoryPrefix<u8, AllocU8>>

Source

fn get_source_copy_command<'a, ISlice: SliceWrapper<u8>>( &self, _: &'a Command<ISlice>, _: &'a CopyCommand, ) -> &'a CopyCommand

Source

fn get_source_literal_command<'a, ISlice: SliceWrapper<u8> + Default>( &self, _: &'a Command<ISlice>, _: &'a LiteralCommand<ISlice>, ) -> &'a LiteralCommand<ISlice>

Source

fn get_source_dict_command<'a, ISlice: SliceWrapper<u8>>( &self, _: &'a Command<ISlice>, _: &'a DictCommand, ) -> &'a DictCommand

Source

fn get_literal_byte<ISlice: SliceWrapper<u8>>( &self, in_cmd: &LiteralCommand<ISlice>, index: usize, ) -> u8

Source

fn get_recoder_output<'a>( &'a mut self, passed_in_output_bytes: &'a mut [u8], ) -> &'a mut [u8]

Source

fn get_recoder_output_offset<'a>( &self, passed_in_output_bytes: &'a mut usize, backing: &'a mut usize, ) -> &'a mut usize

Provided Methods§

Source

fn adapt_cdf(&self) -> bool

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§