# Trait nom::branch::Alt

source · [−]

    pub trait Alt<I, O, E> {
        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: 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>

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>

## Implementors