Struct encoding::codec::singlebyte::SingleByteEncodingUnstable [-]  [+] [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 encoder(&self) -> Box<Encoder>

fn decoder(&self) -> Box<Decoder>

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

fn decode(&self, input: &[u8], trap: DecoderTrap) -> Result<String, SendStr>