pub fn apply<'a, A, P>(mut parser: P, input: &'a [char]) -> Option<A>
where
    P: Parser<A, &'a [char]>,
{
    match parser.parse(input) {
        Some((output, tail)) if tail.is_empty() => Some(output),
        Some(_) | None => None,
    }
}
/// Applies a parser and returns the output value if the entirety of the input has been parsed successfully.
Applies a parser and returns the output value if the entirety of the input has been parsed successfully.
Applies a parser and returns the output value if the entirety of the input has been parsed successfully .
pub fn apply<'a, A, P>(mut parser: P, input: &'a [char]) -> Option<A>
where
    P: Parser<A, &'a [char]>,
{
    match parser.parse(input) {
        Some((output, tail)) if tail.is_empty() => Some(output),
        Some(_) | None => None,
    }
}
pub fn apply < ' a , A , P > ( mut parser : P , input : & ' a [ char ] ) -> Option < A > where P : Parser < A , & ' a [ char ] > , { match parser . parse ( input ) { Some ( ( output , tail ) ) if tail . is_empty ( ) => Some ( output ) , Some ( _ ) | None => None , } }
Applies a parser and returns the output value if the entirety of the input has been parsed successfully.
Applies a parser and returns the output value if the entirety of the input has been parsed successfully .
parser
P
input
&'a [char]