Trait ct_codecs::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.

Object Safety§

This trait is not object safe.

Implementors§