Trait ct_codecs::Encoder[][src]

pub trait Encoder {
    fn encoded_len(bin_len: usize) -> Result<usize, Error>;
fn encode<IN: AsRef<[u8]>>(
        encoded: &mut [u8],
        bin: IN
    ) -> Result<&[u8], Error>; fn encode_to_str<IN: AsRef<[u8]>>(
        encoded: &mut [u8],
        bin: IN
    ) -> Result<&str, Error> { ... }
fn encode_to_string<IN: AsRef<[u8]>>(bin: IN) -> Result<String, Error> { ... } }

Required methods

fn encoded_len(bin_len: usize) -> Result<usize, Error>[src]

Length of bin_len bytes after encoding.

fn encode<IN: AsRef<[u8]>>(encoded: &mut [u8], bin: IN) -> Result<&[u8], Error>[src]

Encode bin into encoded. The output buffer can be larger than required; the returned slice is a view of the buffer with the correct length.

Loading content...

Provided methods

fn encode_to_str<IN: AsRef<[u8]>>(
    encoded: &mut [u8],
    bin: IN
) -> Result<&str, Error>
[src]

Encode bin into encoded, return the result as a str. The output buffer can be larger than required; the returned slice is a view of the buffer with the correct length.

fn encode_to_string<IN: AsRef<[u8]>>(bin: IN) -> Result<String, Error>[src]

Encode bin as a String.

Loading content...

Implementors

Loading content...