Trait winnow::combinator::Alt

source ·
pub trait Alt<I, O, E> {
    // Required method
    fn choice(&mut self, input: &mut I) -> PResult<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: &mut I) -> PResult<O, E>

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

Implementations on Foreign Types§

source§

impl<I: Stream, O, E: ParserError<I>, A: Parser<I, O, E>> Alt<I, O, E> for (A,)

source§

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

source§

impl<I: Stream, Output, Error: ParserError<I>, Alt2: Parser<I, Output, Error>, Alt3: Parser<I, Output, Error>> Alt<I, Output, Error> for (Alt2, Alt3)

source§

fn choice(&mut self, input: &mut I) -> PResult<Output, Error>

source§

impl<I: Stream, Output, Error: ParserError<I>, Alt2: Parser<I, Output, Error>, Alt3: Parser<I, Output, Error>, Alt4: Parser<I, Output, Error>> Alt<I, Output, Error> for (Alt2, Alt3, Alt4)

source§

fn choice(&mut self, input: &mut I) -> PResult<Output, Error>

source§

impl<I: Stream, Output, Error: ParserError<I>, Alt2: Parser<I, Output, Error>, Alt3: Parser<I, Output, Error>, Alt4: Parser<I, Output, Error>, Alt5: Parser<I, Output, Error>> Alt<I, Output, Error> for (Alt2, Alt3, Alt4, Alt5)

source§

fn choice(&mut self, input: &mut I) -> PResult<Output, Error>

source§

impl<I: Stream, Output, Error: ParserError<I>, Alt2: Parser<I, Output, Error>, Alt3: Parser<I, Output, Error>, Alt4: Parser<I, Output, Error>, Alt5: Parser<I, Output, Error>, Alt6: Parser<I, Output, Error>> Alt<I, Output, Error> for (Alt2, Alt3, Alt4, Alt5, Alt6)

source§

fn choice(&mut self, input: &mut I) -> PResult<Output, Error>

source§

impl<I: Stream, Output, Error: ParserError<I>, Alt2: Parser<I, Output, Error>, Alt3: Parser<I, Output, Error>, Alt4: Parser<I, Output, Error>, Alt5: Parser<I, Output, Error>, Alt6: Parser<I, Output, Error>, Alt7: Parser<I, Output, Error>> Alt<I, Output, Error> for (Alt2, Alt3, Alt4, Alt5, Alt6, Alt7)

source§

fn choice(&mut self, input: &mut I) -> PResult<Output, Error>

source§

impl<I: Stream, Output, Error: ParserError<I>, Alt2: Parser<I, Output, Error>, Alt3: Parser<I, Output, Error>, Alt4: Parser<I, Output, Error>, Alt5: Parser<I, Output, Error>, Alt6: Parser<I, Output, Error>, Alt7: Parser<I, Output, Error>, Alt8: Parser<I, Output, Error>> Alt<I, Output, Error> for (Alt2, Alt3, Alt4, Alt5, Alt6, Alt7, Alt8)

source§

fn choice(&mut self, input: &mut I) -> PResult<Output, Error>

source§

impl<I: Stream, Output, Error: ParserError<I>, Alt2: Parser<I, Output, Error>, Alt3: Parser<I, Output, Error>, Alt4: Parser<I, Output, Error>, Alt5: Parser<I, Output, Error>, Alt6: Parser<I, Output, Error>, Alt7: Parser<I, Output, Error>, Alt8: Parser<I, Output, Error>, Alt9: Parser<I, Output, Error>> Alt<I, Output, Error> for (Alt2, Alt3, Alt4, Alt5, Alt6, Alt7, Alt8, Alt9)

source§

fn choice(&mut self, input: &mut I) -> PResult<Output, Error>

source§

impl<I: Stream, Output, Error: ParserError<I>, Alt2: Parser<I, Output, Error>, Alt3: Parser<I, Output, Error>, Alt4: Parser<I, Output, Error>, Alt5: Parser<I, Output, Error>, Alt6: Parser<I, Output, Error>, Alt7: Parser<I, Output, Error>, Alt8: Parser<I, Output, Error>, Alt9: Parser<I, Output, Error>, Alt10: Parser<I, Output, Error>> Alt<I, Output, Error> for (Alt2, Alt3, Alt4, Alt5, Alt6, Alt7, Alt8, Alt9, Alt10)

source§

fn choice(&mut self, input: &mut I) -> PResult<Output, Error>

source§

impl<I: Stream, Output, Error: ParserError<I>, Alt2: Parser<I, Output, Error>, Alt3: Parser<I, Output, Error>, Alt4: Parser<I, Output, Error>, Alt5: Parser<I, Output, Error>, Alt6: Parser<I, Output, Error>, Alt7: Parser<I, Output, Error>, Alt8: Parser<I, Output, Error>, Alt9: Parser<I, Output, Error>, Alt10: Parser<I, Output, Error>, Alt11: Parser<I, Output, Error>> Alt<I, Output, Error> for (Alt2, Alt3, Alt4, Alt5, Alt6, Alt7, Alt8, Alt9, Alt10, Alt11)

source§

fn choice(&mut self, input: &mut I) -> PResult<Output, Error>

source§

impl<I: Stream, Output, Error: ParserError<I>, Alt2: Parser<I, Output, Error>, Alt3: Parser<I, Output, Error>, Alt4: Parser<I, Output, Error>, Alt5: Parser<I, Output, Error>, Alt6: Parser<I, Output, Error>, Alt7: Parser<I, Output, Error>, Alt8: Parser<I, Output, Error>, Alt9: Parser<I, Output, Error>, Alt10: Parser<I, Output, Error>, Alt11: Parser<I, Output, Error>, Alt12: Parser<I, Output, Error>> Alt<I, Output, Error> for (Alt2, Alt3, Alt4, Alt5, Alt6, Alt7, Alt8, Alt9, Alt10, Alt11, Alt12)

source§

fn choice(&mut self, input: &mut I) -> PResult<Output, Error>

source§

impl<I: Stream, Output, Error: ParserError<I>, Alt2: Parser<I, Output, Error>, Alt3: Parser<I, Output, Error>, Alt4: Parser<I, Output, Error>, Alt5: Parser<I, Output, Error>, Alt6: Parser<I, Output, Error>, Alt7: Parser<I, Output, Error>, Alt8: Parser<I, Output, Error>, Alt9: Parser<I, Output, Error>, Alt10: Parser<I, Output, Error>, Alt11: Parser<I, Output, Error>, Alt12: Parser<I, Output, Error>, Alt13: Parser<I, Output, Error>> Alt<I, Output, Error> for (Alt2, Alt3, Alt4, Alt5, Alt6, Alt7, Alt8, Alt9, Alt10, Alt11, Alt12, Alt13)

source§

fn choice(&mut self, input: &mut I) -> PResult<Output, Error>

source§

impl<I: Stream, Output, Error: ParserError<I>, Alt2: Parser<I, Output, Error>, Alt3: Parser<I, Output, Error>, Alt4: Parser<I, Output, Error>, Alt5: Parser<I, Output, Error>, Alt6: Parser<I, Output, Error>, Alt7: Parser<I, Output, Error>, Alt8: Parser<I, Output, Error>, Alt9: Parser<I, Output, Error>, Alt10: Parser<I, Output, Error>, Alt11: Parser<I, Output, Error>, Alt12: Parser<I, Output, Error>, Alt13: Parser<I, Output, Error>, Alt14: Parser<I, Output, Error>> Alt<I, Output, Error> for (Alt2, Alt3, Alt4, Alt5, Alt6, Alt7, Alt8, Alt9, Alt10, Alt11, Alt12, Alt13, Alt14)

source§

fn choice(&mut self, input: &mut I) -> PResult<Output, Error>

source§

impl<I: Stream, Output, Error: ParserError<I>, Alt2: Parser<I, Output, Error>, Alt3: Parser<I, Output, Error>, Alt4: Parser<I, Output, Error>, Alt5: Parser<I, Output, Error>, Alt6: Parser<I, Output, Error>, Alt7: Parser<I, Output, Error>, Alt8: Parser<I, Output, Error>, Alt9: Parser<I, Output, Error>, Alt10: Parser<I, Output, Error>, Alt11: Parser<I, Output, Error>, Alt12: Parser<I, Output, Error>, Alt13: Parser<I, Output, Error>, Alt14: Parser<I, Output, Error>, Alt15: Parser<I, Output, Error>> Alt<I, Output, Error> for (Alt2, Alt3, Alt4, Alt5, Alt6, Alt7, Alt8, Alt9, Alt10, Alt11, Alt12, Alt13, Alt14, Alt15)

source§

fn choice(&mut self, input: &mut I) -> PResult<Output, Error>

source§

impl<I: Stream, Output, Error: ParserError<I>, Alt2: Parser<I, Output, Error>, Alt3: Parser<I, Output, Error>, Alt4: Parser<I, Output, Error>, Alt5: Parser<I, Output, Error>, Alt6: Parser<I, Output, Error>, Alt7: Parser<I, Output, Error>, Alt8: Parser<I, Output, Error>, Alt9: Parser<I, Output, Error>, Alt10: Parser<I, Output, Error>, Alt11: Parser<I, Output, Error>, Alt12: Parser<I, Output, Error>, Alt13: Parser<I, Output, Error>, Alt14: Parser<I, Output, Error>, Alt15: Parser<I, Output, Error>, Alt16: Parser<I, Output, Error>> Alt<I, Output, Error> for (Alt2, Alt3, Alt4, Alt5, Alt6, Alt7, Alt8, Alt9, Alt10, Alt11, Alt12, Alt13, Alt14, Alt15, Alt16)

source§

fn choice(&mut self, input: &mut I) -> PResult<Output, Error>

source§

impl<I: Stream, Output, Error: ParserError<I>, Alt2: Parser<I, Output, Error>, Alt3: Parser<I, Output, Error>, Alt4: Parser<I, Output, Error>, Alt5: Parser<I, Output, Error>, Alt6: Parser<I, Output, Error>, Alt7: Parser<I, Output, Error>, Alt8: Parser<I, Output, Error>, Alt9: Parser<I, Output, Error>, Alt10: Parser<I, Output, Error>, Alt11: Parser<I, Output, Error>, Alt12: Parser<I, Output, Error>, Alt13: Parser<I, Output, Error>, Alt14: Parser<I, Output, Error>, Alt15: Parser<I, Output, Error>, Alt16: Parser<I, Output, Error>, Alt17: Parser<I, Output, Error>> Alt<I, Output, Error> for (Alt2, Alt3, Alt4, Alt5, Alt6, Alt7, Alt8, Alt9, Alt10, Alt11, Alt12, Alt13, Alt14, Alt15, Alt16, Alt17)

source§

fn choice(&mut self, input: &mut I) -> PResult<Output, Error>

source§

impl<I: Stream, Output, Error: ParserError<I>, Alt2: Parser<I, Output, Error>, Alt3: Parser<I, Output, Error>, Alt4: Parser<I, Output, Error>, Alt5: Parser<I, Output, Error>, Alt6: Parser<I, Output, Error>, Alt7: Parser<I, Output, Error>, Alt8: Parser<I, Output, Error>, Alt9: Parser<I, Output, Error>, Alt10: Parser<I, Output, Error>, Alt11: Parser<I, Output, Error>, Alt12: Parser<I, Output, Error>, Alt13: Parser<I, Output, Error>, Alt14: Parser<I, Output, Error>, Alt15: Parser<I, Output, Error>, Alt16: Parser<I, Output, Error>, Alt17: Parser<I, Output, Error>, Alt18: Parser<I, Output, Error>> Alt<I, Output, Error> for (Alt2, Alt3, Alt4, Alt5, Alt6, Alt7, Alt8, Alt9, Alt10, Alt11, Alt12, Alt13, Alt14, Alt15, Alt16, Alt17, Alt18)

source§

fn choice(&mut self, input: &mut I) -> PResult<Output, Error>

source§

impl<I: Stream, Output, Error: ParserError<I>, Alt2: Parser<I, Output, Error>, Alt3: Parser<I, Output, Error>, Alt4: Parser<I, Output, Error>, Alt5: Parser<I, Output, Error>, Alt6: Parser<I, Output, Error>, Alt7: Parser<I, Output, Error>, Alt8: Parser<I, Output, Error>, Alt9: Parser<I, Output, Error>, Alt10: Parser<I, Output, Error>, Alt11: Parser<I, Output, Error>, Alt12: Parser<I, Output, Error>, Alt13: Parser<I, Output, Error>, Alt14: Parser<I, Output, Error>, Alt15: Parser<I, Output, Error>, Alt16: Parser<I, Output, Error>, Alt17: Parser<I, Output, Error>, Alt18: Parser<I, Output, Error>, Alt19: Parser<I, Output, Error>> Alt<I, Output, Error> for (Alt2, Alt3, Alt4, Alt5, Alt6, Alt7, Alt8, Alt9, Alt10, Alt11, Alt12, Alt13, Alt14, Alt15, Alt16, Alt17, Alt18, Alt19)

source§

fn choice(&mut self, input: &mut I) -> PResult<Output, Error>

source§

impl<I: Stream, Output, Error: ParserError<I>, Alt2: Parser<I, Output, Error>, Alt3: Parser<I, Output, Error>, Alt4: Parser<I, Output, Error>, Alt5: Parser<I, Output, Error>, Alt6: Parser<I, Output, Error>, Alt7: Parser<I, Output, Error>, Alt8: Parser<I, Output, Error>, Alt9: Parser<I, Output, Error>, Alt10: Parser<I, Output, Error>, Alt11: Parser<I, Output, Error>, Alt12: Parser<I, Output, Error>, Alt13: Parser<I, Output, Error>, Alt14: Parser<I, Output, Error>, Alt15: Parser<I, Output, Error>, Alt16: Parser<I, Output, Error>, Alt17: Parser<I, Output, Error>, Alt18: Parser<I, Output, Error>, Alt19: Parser<I, Output, Error>, Alt20: Parser<I, Output, Error>> Alt<I, Output, Error> for (Alt2, Alt3, Alt4, Alt5, Alt6, Alt7, Alt8, Alt9, Alt10, Alt11, Alt12, Alt13, Alt14, Alt15, Alt16, Alt17, Alt18, Alt19, Alt20)

source§

fn choice(&mut self, input: &mut I) -> PResult<Output, Error>

source§

impl<I: Stream, Output, Error: ParserError<I>, Alt2: Parser<I, Output, Error>, Alt3: Parser<I, Output, Error>, Alt4: Parser<I, Output, Error>, Alt5: Parser<I, Output, Error>, Alt6: Parser<I, Output, Error>, Alt7: Parser<I, Output, Error>, Alt8: Parser<I, Output, Error>, Alt9: Parser<I, Output, Error>, Alt10: Parser<I, Output, Error>, Alt11: Parser<I, Output, Error>, Alt12: Parser<I, Output, Error>, Alt13: Parser<I, Output, Error>, Alt14: Parser<I, Output, Error>, Alt15: Parser<I, Output, Error>, Alt16: Parser<I, Output, Error>, Alt17: Parser<I, Output, Error>, Alt18: Parser<I, Output, Error>, Alt19: Parser<I, Output, Error>, Alt20: Parser<I, Output, Error>, Alt21: Parser<I, Output, Error>> Alt<I, Output, Error> for (Alt2, Alt3, Alt4, Alt5, Alt6, Alt7, Alt8, Alt9, Alt10, Alt11, Alt12, Alt13, Alt14, Alt15, Alt16, Alt17, Alt18, Alt19, Alt20, Alt21)

source§

fn choice(&mut self, input: &mut I) -> PResult<Output, Error>

source§

impl<I: Stream, Output, Error: ParserError<I>, Alt2: Parser<I, Output, Error>, Alt3: Parser<I, Output, Error>, Alt4: Parser<I, Output, Error>, Alt5: Parser<I, Output, Error>, Alt6: Parser<I, Output, Error>, Alt7: Parser<I, Output, Error>, Alt8: Parser<I, Output, Error>, Alt9: Parser<I, Output, Error>, Alt10: Parser<I, Output, Error>, Alt11: Parser<I, Output, Error>, Alt12: Parser<I, Output, Error>, Alt13: Parser<I, Output, Error>, Alt14: Parser<I, Output, Error>, Alt15: Parser<I, Output, Error>, Alt16: Parser<I, Output, Error>, Alt17: Parser<I, Output, Error>, Alt18: Parser<I, Output, Error>, Alt19: Parser<I, Output, Error>, Alt20: Parser<I, Output, Error>, Alt21: Parser<I, Output, Error>, Alt22: Parser<I, Output, Error>> Alt<I, Output, Error> for (Alt2, Alt3, Alt4, Alt5, Alt6, Alt7, Alt8, Alt9, Alt10, Alt11, Alt12, Alt13, Alt14, Alt15, Alt16, Alt17, Alt18, Alt19, Alt20, Alt21, Alt22)

source§

fn choice(&mut self, input: &mut I) -> PResult<Output, Error>

source§

impl<const N: usize, I: Stream, O, E: ParserError<I>, P: Parser<I, O, E>> Alt<I, O, E> for [P; N]

source§

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

Implementors§