pub fn any_utf8_str(ctx: ParserContext<&str>) -> Res<&str, &str>
Expand description

A parser that recognizes the first unicode scalar value at the start of a string slice.

A unicode scalar value is not always what you might consider a “character”. This function will output the first thing that rust considers a char.

Errors

An error is reported if the string slice is empty

use parser_compose::{Parser, any_utf8_str};

let msg = "👻Boo";

let (value, rest) = any_utf8_str(msg.into()).unwrap();

assert_eq!(value, "👻");