Textcode

Trait Textcode 

Source
pub trait Textcode {
    // Required methods
    fn decode<W: Write, R: AsRef<[u8]>>(src: R, dst: &mut W) -> Result<usize>;
    fn encode<W: Write, R: AsRef<str>>(src: R, dst: &mut W) -> Result<usize>;
}
Expand description

Trait for text encoding/decoding implementations.

Types implementing this trait provide conversion between a specific character encoding and UTF-8.

Required Methods§

Source

fn decode<W: Write, R: AsRef<[u8]>>(src: R, dst: &mut W) -> Result<usize>

Decodes bytes from the source encoding to UTF-8.

Source

fn encode<W: Write, R: AsRef<str>>(src: R, dst: &mut W) -> Result<usize>

Encodes UTF-8 string to the target encoding.

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§