Function vec

Source
pub fn vec<T>(v: Vec<T>) -> VecEqualParser<T>
Expand description

Compare the input starts with the given slice.

This will copy all the characters into std::vec::Vec, so lifetime belongs to the parser itself.

Output: ()

ยงExample

use rusty_parser as rp;
use rp::IntoParser;

let hello_parser = rp::vec(vec![104, 101, 108, 108, 111]);
let hello_parser = (vec![104, 101, 108, 108, 111]).into_parser();