Skip to main content

Decode

Trait Decode 

Source
pub trait Decode {
    // Required methods
    fn reinit(&mut self) -> Result<()>;
    fn decode(
        &mut self,
        input: &mut PartialBuffer<impl AsRef<[u8]>>,
        output: &mut PartialBuffer<impl AsRef<[u8]> + AsMut<[u8]>>,
    ) -> Result<bool>;
    fn flush(
        &mut self,
        output: &mut PartialBuffer<impl AsRef<[u8]> + AsMut<[u8]>>,
    ) -> Result<bool>;
    fn finish(
        &mut self,
        output: &mut PartialBuffer<impl AsRef<[u8]> + AsMut<[u8]>>,
    ) -> Result<bool>;
}

Required Methods§

Source

fn reinit(&mut self) -> Result<()>

Reinitializes this decoder ready to decode a new member/frame of data.

Source

fn decode( &mut self, input: &mut PartialBuffer<impl AsRef<[u8]>>, output: &mut PartialBuffer<impl AsRef<[u8]> + AsMut<[u8]>>, ) -> Result<bool>

Returns whether the end of the stream has been read

Source

fn flush( &mut self, output: &mut PartialBuffer<impl AsRef<[u8]> + AsMut<[u8]>>, ) -> Result<bool>

Returns whether the internal buffers are flushed

Source

fn finish( &mut self, output: &mut PartialBuffer<impl AsRef<[u8]> + AsMut<[u8]>>, ) -> Result<bool>

Returns whether the internal buffers are flushed

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

Source§

impl<T: DecodeV2 + ?Sized> Decode for T