Trait Encoder

Source
pub trait Encoder {
    // Required methods
    fn to_string(&self, data: &[u8]) -> Result<String>;
    fn to_bytes(&self, data: &str) -> Result<Vec<u8>>;
}
Expand description

Converter between string and multibyte encoding.

Required Methods§

Source

fn to_string(&self, data: &[u8]) -> Result<String>

Convert from bytes to string.

Source

fn to_bytes(&self, data: &str) -> Result<Vec<u8>>

Convert from string to bytes.

Implementors§