Struct encoding::codec::singlebyte::SingleByteEncoding [] [src]

pub struct SingleByteEncoding {
    pub name: &'static str,
    pub whatwg_name: Option<&'static str>,
    pub index_forward: fn(u8) -> u16,
    pub index_backward: fn(u32) -> u8,
}

A common framework for single-byte encodings based on ASCII.

Fields

name
whatwg_name
index_forward
index_backward

Trait Implementations

impl Encoding for SingleByteEncoding

fn name(&self) -> &'static str

fn whatwg_name(&self) -> Option<&'static str>

fn raw_encoder(&self) -> Box<RawEncoder>

fn raw_decoder(&self) -> Box<RawDecoder>

fn encode(&self, input: &str, trap: EncoderTrap) -> Result<Vec<u8>, Cow<'static, str>>

fn encode_to(&self, input: &str, trap: EncoderTrap, ret: &mut ByteWriter) -> Result<(), Cow<'static, str>>

fn decode(&self, input: &[u8], trap: DecoderTrap) -> Result<String, Cow<'static, str>>

fn decode_to(&self, input: &[u8], trap: DecoderTrap, ret: &mut StringWriter) -> Result<(), Cow<'static, str>>

Derived Implementations

impl Clone for SingleByteEncoding

fn clone(&self) -> SingleByteEncoding

fn clone_from(&mut self, source: &Self)

impl Copy for SingleByteEncoding