Type Definition gutenberg_post_parser::Input [−][src]
type Input<'a> = &'a [InputElement];
Represent the type of a parser input.
The parser does not analyse a String
nor a &str
, but a slice
of bytes &[u8]
. One of the consequence is that there is no UTF-8
validation (Rust guarantees that all strings are valid UTF-8
data). There is many arguments for this decision, one of them is
that the post format are likely to contain JSON encoded data, and
JSON has a weird encoding format for strings (e.g. surrogate
pairs), which might not be compatible with UTF-8. Other arguments
are mostly related to memory efficiency.