ct_codecs

Trait Decoder

Source
pub trait Decoder {
    // Required method
    fn decode<'t, IN: AsRef<[u8]>>(
        bin: &'t mut [u8],
        encoded: IN,
        ignore: Option<&[u8]>,
    ) -> Result<&'t [u8], Error>;

    // Provided method
    fn decode_to_vec<IN: AsRef<[u8]>>(
        encoded: IN,
        ignore: Option<&[u8]>,
    ) -> Result<Vec<u8>, Error> { ... }
}

Required Methods§

Source

fn decode<'t, IN: AsRef<[u8]>>( bin: &'t mut [u8], encoded: IN, ignore: Option<&[u8]>, ) -> Result<&'t [u8], Error>

Decode encoded into bin. The output buffer can be larger than required; the returned slice is a view of the buffer with the correct length. ignore is an optional set of characters to ignore.

Provided Methods§

Source

fn decode_to_vec<IN: AsRef<[u8]>>( encoded: IN, ignore: Option<&[u8]>, ) -> Result<Vec<u8>, Error>

Decode encoded into a Vec<u8>. ignore is an optional set of characters to ignore.

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§