pub fn tuple<I, O, E: ParseError<I>, List: Tuple<I, O, E>>(
l: List
) -> impl FnMut(I) -> IResult<I, O, E>
👎Deprecated since 8.0.0:
Parser
is directly implemented for tuplesExpand description
Applies a tuple of parsers one by one and returns their results as a tuple. There is a maximum of 21 parsers
WARNING: Deprecated, Parser
is directly implemented for tuples
use nom8::sequence::tuple;
use nom8::character::{alpha1, digit1};
let mut parser = tuple((alpha1, digit1, alpha1));
assert_eq!(parser("abc123def"), Ok(("", ("abc", "123", "def"))));
assert_eq!(parser("123def"), Err(Err::Error(("123def", ErrorKind::Alpha))));