Function ecoji::decode_to_vec [] [src]

pub fn decode_to_vec<R: Read + ?Sized>(source: &mut R) -> Result<Vec<u8>>

Decodes the entire source from the Ecoji format (assumed to be UTF-8-encoded), storing the result of the decoding to a new byte vector.

Returns a byte vector with the decoded data if successful.

Failure conditions are exactly the same as those of the decode function.

Examples

Successful decoding:

let input = "👶😲🇲👅🍉🔙🌥🌩";
let output: Vec<u8> = ecoji::decode_to_vec(&mut input.as_bytes())?;

assert_eq!(output, b"input data");

See decode docs for error examples.