nom::branch

Trait Alt

Source
pub trait Alt<I, O, E> {
    // Required method
    fn choice(&mut self, input: I) -> IResult<I, O, E>;
}
Expand description

Helper trait for the alt() combinator.

This trait is implemented for tuples of up to 21 elements

Required Methods§

Source

fn choice(&mut self, input: I) -> IResult<I, O, E>

Tests each parser in the tuple and returns the result of the first one that succeeds

Implementations on Foreign Types§

Source§

impl<Input, Output, Error: ParseError<Input>, A: Parser<Input, Output, Error>> Alt<Input, Output, Error> for (A,)

Source§

fn choice(&mut self, input: Input) -> IResult<Input, Output, Error>

Source§

impl<Input: Clone, Output, Error: ParseError<Input>, A: Parser<Input, Output, Error>, B: Parser<Input, Output, Error>> Alt<Input, Output, Error> for (A, B)

Source§

fn choice(&mut self, input: Input) -> IResult<Input, Output, Error>

Source§

impl<Input: Clone, Output, Error: ParseError<Input>, A: Parser<Input, Output, Error>, B: Parser<Input, Output, Error>, C: Parser<Input, Output, Error>> Alt<Input, Output, Error> for (A, B, C)

Source§

fn choice(&mut self, input: Input) -> IResult<Input, Output, Error>

Source§

impl<Input: Clone, Output, Error: ParseError<Input>, A: Parser<Input, Output, Error>, B: Parser<Input, Output, Error>, C: Parser<Input, Output, Error>, D: Parser<Input, Output, Error>> Alt<Input, Output, Error> for (A, B, C, D)

Source§

fn choice(&mut self, input: Input) -> IResult<Input, Output, Error>

Source§

impl<Input: Clone, Output, Error: ParseError<Input>, A: Parser<Input, Output, Error>, B: Parser<Input, Output, Error>, C: Parser<Input, Output, Error>, D: Parser<Input, Output, Error>, E: Parser<Input, Output, Error>> Alt<Input, Output, Error> for (A, B, C, D, E)

Source§

fn choice(&mut self, input: Input) -> IResult<Input, Output, Error>

Source§

impl<Input: Clone, Output, Error: ParseError<Input>, A: Parser<Input, Output, Error>, B: Parser<Input, Output, Error>, C: Parser<Input, Output, Error>, D: Parser<Input, Output, Error>, E: Parser<Input, Output, Error>, F: Parser<Input, Output, Error>> Alt<Input, Output, Error> for (A, B, C, D, E, F)

Source§

fn choice(&mut self, input: Input) -> IResult<Input, Output, Error>

Source§

impl<Input: Clone, Output, Error: ParseError<Input>, A: Parser<Input, Output, Error>, B: Parser<Input, Output, Error>, C: Parser<Input, Output, Error>, D: Parser<Input, Output, Error>, E: Parser<Input, Output, Error>, F: Parser<Input, Output, Error>, G: Parser<Input, Output, Error>> Alt<Input, Output, Error> for (A, B, C, D, E, F, G)

Source§

fn choice(&mut self, input: Input) -> IResult<Input, Output, Error>

Source§

impl<Input: Clone, Output, Error: ParseError<Input>, A: Parser<Input, Output, Error>, B: Parser<Input, Output, Error>, C: Parser<Input, Output, Error>, D: Parser<Input, Output, Error>, E: Parser<Input, Output, Error>, F: Parser<Input, Output, Error>, G: Parser<Input, Output, Error>, H: Parser<Input, Output, Error>> Alt<Input, Output, Error> for (A, B, C, D, E, F, G, H)

Source§

fn choice(&mut self, input: Input) -> IResult<Input, Output, Error>

Source§

impl<Input: Clone, Output, Error: ParseError<Input>, A: Parser<Input, Output, Error>, B: Parser<Input, Output, Error>, C: Parser<Input, Output, Error>, D: Parser<Input, Output, Error>, E: Parser<Input, Output, Error>, F: Parser<Input, Output, Error>, G: Parser<Input, Output, Error>, H: Parser<Input, Output, Error>, I: Parser<Input, Output, Error>> Alt<Input, Output, Error> for (A, B, C, D, E, F, G, H, I)

Source§

fn choice(&mut self, input: Input) -> IResult<Input, Output, Error>

Source§

impl<Input: Clone, Output, Error: ParseError<Input>, A: Parser<Input, Output, Error>, B: Parser<Input, Output, Error>, C: Parser<Input, Output, Error>, D: Parser<Input, Output, Error>, E: Parser<Input, Output, Error>, F: Parser<Input, Output, Error>, G: Parser<Input, Output, Error>, H: Parser<Input, Output, Error>, I: Parser<Input, Output, Error>, J: Parser<Input, Output, Error>> Alt<Input, Output, Error> for (A, B, C, D, E, F, G, H, I, J)

Source§

fn choice(&mut self, input: Input) -> IResult<Input, Output, Error>

Source§

impl<Input: Clone, Output, Error: ParseError<Input>, A: Parser<Input, Output, Error>, B: Parser<Input, Output, Error>, C: Parser<Input, Output, Error>, D: Parser<Input, Output, Error>, E: Parser<Input, Output, Error>, F: Parser<Input, Output, Error>, G: Parser<Input, Output, Error>, H: Parser<Input, Output, Error>, I: Parser<Input, Output, Error>, J: Parser<Input, Output, Error>, K: Parser<Input, Output, Error>> Alt<Input, Output, Error> for (A, B, C, D, E, F, G, H, I, J, K)

Source§

fn choice(&mut self, input: Input) -> IResult<Input, Output, Error>

Source§

impl<Input: Clone, Output, Error: ParseError<Input>, A: Parser<Input, Output, Error>, B: Parser<Input, Output, Error>, C: Parser<Input, Output, Error>, D: Parser<Input, Output, Error>, E: Parser<Input, Output, Error>, F: Parser<Input, Output, Error>, G: Parser<Input, Output, Error>, H: Parser<Input, Output, Error>, I: Parser<Input, Output, Error>, J: Parser<Input, Output, Error>, K: Parser<Input, Output, Error>, L: Parser<Input, Output, Error>> Alt<Input, Output, Error> for (A, B, C, D, E, F, G, H, I, J, K, L)

Source§

fn choice(&mut self, input: Input) -> IResult<Input, Output, Error>

Source§

impl<Input: Clone, Output, Error: ParseError<Input>, A: Parser<Input, Output, Error>, B: Parser<Input, Output, Error>, C: Parser<Input, Output, Error>, D: Parser<Input, Output, Error>, E: Parser<Input, Output, Error>, F: Parser<Input, Output, Error>, G: Parser<Input, Output, Error>, H: Parser<Input, Output, Error>, I: Parser<Input, Output, Error>, J: Parser<Input, Output, Error>, K: Parser<Input, Output, Error>, L: Parser<Input, Output, Error>, M: Parser<Input, Output, Error>> Alt<Input, Output, Error> for (A, B, C, D, E, F, G, H, I, J, K, L, M)

Source§

fn choice(&mut self, input: Input) -> IResult<Input, Output, Error>

Source§

impl<Input: Clone, Output, Error: ParseError<Input>, A: Parser<Input, Output, Error>, B: Parser<Input, Output, Error>, C: Parser<Input, Output, Error>, D: Parser<Input, Output, Error>, E: Parser<Input, Output, Error>, F: Parser<Input, Output, Error>, G: Parser<Input, Output, Error>, H: Parser<Input, Output, Error>, I: Parser<Input, Output, Error>, J: Parser<Input, Output, Error>, K: Parser<Input, Output, Error>, L: Parser<Input, Output, Error>, M: Parser<Input, Output, Error>, N: Parser<Input, Output, Error>> Alt<Input, Output, Error> for (A, B, C, D, E, F, G, H, I, J, K, L, M, N)

Source§

fn choice(&mut self, input: Input) -> IResult<Input, Output, Error>

Source§

impl<Input: Clone, Output, Error: ParseError<Input>, A: Parser<Input, Output, Error>, B: Parser<Input, Output, Error>, C: Parser<Input, Output, Error>, D: Parser<Input, Output, Error>, E: Parser<Input, Output, Error>, F: Parser<Input, Output, Error>, G: Parser<Input, Output, Error>, H: Parser<Input, Output, Error>, I: Parser<Input, Output, Error>, J: Parser<Input, Output, Error>, K: Parser<Input, Output, Error>, L: Parser<Input, Output, Error>, M: Parser<Input, Output, Error>, N: Parser<Input, Output, Error>, O: Parser<Input, Output, Error>> Alt<Input, Output, Error> for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O)

Source§

fn choice(&mut self, input: Input) -> IResult<Input, Output, Error>

Source§

impl<Input: Clone, Output, Error: ParseError<Input>, A: Parser<Input, Output, Error>, B: Parser<Input, Output, Error>, C: Parser<Input, Output, Error>, D: Parser<Input, Output, Error>, E: Parser<Input, Output, Error>, F: Parser<Input, Output, Error>, G: Parser<Input, Output, Error>, H: Parser<Input, Output, Error>, I: Parser<Input, Output, Error>, J: Parser<Input, Output, Error>, K: Parser<Input, Output, Error>, L: Parser<Input, Output, Error>, M: Parser<Input, Output, Error>, N: Parser<Input, Output, Error>, O: Parser<Input, Output, Error>, P: Parser<Input, Output, Error>> Alt<Input, Output, Error> for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P)

Source§

fn choice(&mut self, input: Input) -> IResult<Input, Output, Error>

Source§

impl<Input: Clone, Output, Error: ParseError<Input>, A: Parser<Input, Output, Error>, B: Parser<Input, Output, Error>, C: Parser<Input, Output, Error>, D: Parser<Input, Output, Error>, E: Parser<Input, Output, Error>, F: Parser<Input, Output, Error>, G: Parser<Input, Output, Error>, H: Parser<Input, Output, Error>, I: Parser<Input, Output, Error>, J: Parser<Input, Output, Error>, K: Parser<Input, Output, Error>, L: Parser<Input, Output, Error>, M: Parser<Input, Output, Error>, N: Parser<Input, Output, Error>, O: Parser<Input, Output, Error>, P: Parser<Input, Output, Error>, Q: Parser<Input, Output, Error>> Alt<Input, Output, Error> for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q)

Source§

fn choice(&mut self, input: Input) -> IResult<Input, Output, Error>

Source§

impl<Input: Clone, Output, Error: ParseError<Input>, A: Parser<Input, Output, Error>, B: Parser<Input, Output, Error>, C: Parser<Input, Output, Error>, D: Parser<Input, Output, Error>, E: Parser<Input, Output, Error>, F: Parser<Input, Output, Error>, G: Parser<Input, Output, Error>, H: Parser<Input, Output, Error>, I: Parser<Input, Output, Error>, J: Parser<Input, Output, Error>, K: Parser<Input, Output, Error>, L: Parser<Input, Output, Error>, M: Parser<Input, Output, Error>, N: Parser<Input, Output, Error>, O: Parser<Input, Output, Error>, P: Parser<Input, Output, Error>, Q: Parser<Input, Output, Error>, R: Parser<Input, Output, Error>> Alt<Input, Output, Error> for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R)

Source§

fn choice(&mut self, input: Input) -> IResult<Input, Output, Error>

Source§

impl<Input: Clone, Output, Error: ParseError<Input>, A: Parser<Input, Output, Error>, B: Parser<Input, Output, Error>, C: Parser<Input, Output, Error>, D: Parser<Input, Output, Error>, E: Parser<Input, Output, Error>, F: Parser<Input, Output, Error>, G: Parser<Input, Output, Error>, H: Parser<Input, Output, Error>, I: Parser<Input, Output, Error>, J: Parser<Input, Output, Error>, K: Parser<Input, Output, Error>, L: Parser<Input, Output, Error>, M: Parser<Input, Output, Error>, N: Parser<Input, Output, Error>, O: Parser<Input, Output, Error>, P: Parser<Input, Output, Error>, Q: Parser<Input, Output, Error>, R: Parser<Input, Output, Error>, S: Parser<Input, Output, Error>> Alt<Input, Output, Error> for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S)

Source§

fn choice(&mut self, input: Input) -> IResult<Input, Output, Error>

Source§

impl<Input: Clone, Output, Error: ParseError<Input>, A: Parser<Input, Output, Error>, B: Parser<Input, Output, Error>, C: Parser<Input, Output, Error>, D: Parser<Input, Output, Error>, E: Parser<Input, Output, Error>, F: Parser<Input, Output, Error>, G: Parser<Input, Output, Error>, H: Parser<Input, Output, Error>, I: Parser<Input, Output, Error>, J: Parser<Input, Output, Error>, K: Parser<Input, Output, Error>, L: Parser<Input, Output, Error>, M: Parser<Input, Output, Error>, N: Parser<Input, Output, Error>, O: Parser<Input, Output, Error>, P: Parser<Input, Output, Error>, Q: Parser<Input, Output, Error>, R: Parser<Input, Output, Error>, S: Parser<Input, Output, Error>, T: Parser<Input, Output, Error>> Alt<Input, Output, Error> for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T)

Source§

fn choice(&mut self, input: Input) -> IResult<Input, Output, Error>

Source§

impl<Input: Clone, Output, Error: ParseError<Input>, A: Parser<Input, Output, Error>, B: Parser<Input, Output, Error>, C: Parser<Input, Output, Error>, D: Parser<Input, Output, Error>, E: Parser<Input, Output, Error>, F: Parser<Input, Output, Error>, G: Parser<Input, Output, Error>, H: Parser<Input, Output, Error>, I: Parser<Input, Output, Error>, J: Parser<Input, Output, Error>, K: Parser<Input, Output, Error>, L: Parser<Input, Output, Error>, M: Parser<Input, Output, Error>, N: Parser<Input, Output, Error>, O: Parser<Input, Output, Error>, P: Parser<Input, Output, Error>, Q: Parser<Input, Output, Error>, R: Parser<Input, Output, Error>, S: Parser<Input, Output, Error>, T: Parser<Input, Output, Error>, U: Parser<Input, Output, Error>> Alt<Input, Output, Error> for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U)

Source§

fn choice(&mut self, input: Input) -> IResult<Input, Output, Error>

Implementors§