Function chomp::parsers::string [] [src]

pub fn string<'a, 'b, I: Copy + PartialEq>(i: Input<'a, I>, s: &'b [I]) -> SimpleResult<'a, I, &'a [I]>

Matches the given slice against the parser, returning the matched slice upon success.

If the length of the contained data is shorter than the given slice this parser is considered incomplete.

use chomp::{parse_only, string};

assert_eq!(parse_only(|i| string(i, b"abc"), b"abcdef"), Ok(&b"abc"[..]));