[][src]Crate rut

rut - A compact byte-wise UTF-8 parser for Rust.

This crate was originally part of Termiku.
As such, the API is pretty bare currently, and some issues are not handled yet (like overlong sequences).

However, it is usable, and #[no_std] compatible.

Examples

use rut::Utf8Parser;
 
let mut p = Utf8Parser::new();
 
// UTF-8 representation of '€'
let bytes = [0xE2, 0x82, 0xAC];
 
assert_eq!(p.parse_byte(bytes[0]), Ok(None));
assert_eq!(p.parse_byte(bytes[1]), Ok(None));
assert_eq!(p.parse_byte(bytes[2]), Ok(Some('€')));

Structs

Utf8Parser

Enums

Utf8ParserError