combine::parser::char

Function string

Source
pub fn string<I>(s: &'static str) -> Str<I>
where I: Stream<Item = char>, I::Error: ParseError<I::Item, I::Range, I::Position>,
Expand description

Parses the string s.

let result = string("rust")
    .parse("rust")
    .map(|x| x.0);
assert_eq!(result, Ok("rust"));