[][src]Function quoted_string::parse

pub fn parse<Impl: GeneralQSSpec>(
    input: &str
) -> Result<Parsed, (usize, CoreError)>

parse a quoted string starting at the begin of input but possible ending earlier

To check if the whole string is a quoted-string (an nothing more) you have to additional check if parsed.tail is empty.

Error

a error and the char index where it was triggered is returned if the input does not start with a valid quoted-string.

Example

// use your own Spec
use quoted_string::test_utils::TestSpec;
use quoted_string::{parse, Parsed};

let parsed = parse::<TestSpec>("\"list of\"; \"quoted strings\"").unwrap();
assert_eq!(parsed, Parsed {
    quoted_string: "\"list of\"",
    tail:  "; \"quoted strings\""
});