Function parse_choice

Source
fn parse_choice<'i>(
    input: &'i [u8],
    choices: &[&'static [u8]],
) -> Result<(usize, &'i [u8]), Error>
Expand description

Parses the input such that, on success, the index of the first matching choice (via ASCII case insensitive comparisons) is returned, along with any remaining unparsed input.

If no choice given is a prefix of the input, then an error is returned. The error includes the possible allowed choices.