devela::_dep::winnow::combinator

Trait Alt

pub trait Alt<I, O, E> {
    // Required method
    fn choice(&mut self, input: &mut I) -> Result<O, ErrMode<E>> ;
}
Available on crate feature dep_winnow only.
Expand description

Helper trait for the alt() combinator.

This trait is implemented for tuples of up to 21 elements

Required Methods§

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

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

Implementations on Foreign Types§

§

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

§

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

§

impl<I, O, E, P> Alt<I, O, E> for &mut [P]
where I: Stream, E: ParserError<I>, P: Parser<I, O, E>,

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

impl<I, Output, Error, Alt2, Alt3, Alt4, Alt5, Alt6> Alt<I, Output, Error> for (Alt2, Alt3, Alt4, Alt5, Alt6)
where I: Stream, 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>,

§

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

§

impl<I, Output, Error, Alt2, Alt3, Alt4, Alt5, Alt6, Alt7> Alt<I, Output, Error> for (Alt2, Alt3, Alt4, Alt5, Alt6, Alt7)
where I: Stream, 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>,

§

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

§

impl<I, Output, Error, Alt2, Alt3, Alt4, Alt5, Alt6, Alt7, Alt8> Alt<I, Output, Error> for (Alt2, Alt3, Alt4, Alt5, Alt6, Alt7, Alt8)
where I: Stream, 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>,

§

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

§

impl<I, Output, Error, Alt2, Alt3, Alt4, Alt5, Alt6, Alt7, Alt8, Alt9> Alt<I, Output, Error> for (Alt2, Alt3, Alt4, Alt5, Alt6, Alt7, Alt8, Alt9)
where I: Stream, 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>,

§

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

§

impl<I, Output, Error, Alt2, Alt3, Alt4, Alt5, Alt6, Alt7, Alt8, Alt9, Alt10> Alt<I, Output, Error> for (Alt2, Alt3, Alt4, Alt5, Alt6, Alt7, Alt8, Alt9, Alt10)
where I: Stream, 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>,

§

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

§

impl<I, Output, Error, Alt2, Alt3, Alt4, Alt5, Alt6, Alt7, Alt8, Alt9, Alt10, Alt11> Alt<I, Output, Error> for (Alt2, Alt3, Alt4, Alt5, Alt6, Alt7, Alt8, Alt9, Alt10, Alt11)
where I: Stream, 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>,

§

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

§

impl<I, Output, Error, Alt2, Alt3, Alt4, Alt5, Alt6, Alt7, Alt8, Alt9, Alt10, Alt11, Alt12> Alt<I, Output, Error> for (Alt2, Alt3, Alt4, Alt5, Alt6, Alt7, Alt8, Alt9, Alt10, Alt11, Alt12)
where I: Stream, 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>,

§

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

§

impl<I, Output, Error, Alt2, Alt3, Alt4, Alt5, Alt6, Alt7, Alt8, Alt9, Alt10, Alt11, Alt12, Alt13> Alt<I, Output, Error> for (Alt2, Alt3, Alt4, Alt5, Alt6, Alt7, Alt8, Alt9, Alt10, Alt11, Alt12, Alt13)
where I: Stream, 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>,

§

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

§

impl<I, Output, Error, Alt2, Alt3, Alt4, Alt5, Alt6, Alt7, Alt8, Alt9, Alt10, Alt11, Alt12, Alt13, Alt14> Alt<I, Output, Error> for (Alt2, Alt3, Alt4, Alt5, Alt6, Alt7, Alt8, Alt9, Alt10, Alt11, Alt12, Alt13, Alt14)
where I: Stream, 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>,

§

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

§

impl<I, Output, Error, Alt2, Alt3, Alt4, Alt5, Alt6, Alt7, Alt8, Alt9, Alt10, Alt11, Alt12, Alt13, Alt14, Alt15> Alt<I, Output, Error> for (Alt2, Alt3, Alt4, Alt5, Alt6, Alt7, Alt8, Alt9, Alt10, Alt11, Alt12, Alt13, Alt14, Alt15)
where I: Stream, 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>,

§

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

§

impl<I, Output, Error, Alt2, Alt3, Alt4, Alt5, Alt6, Alt7, Alt8, Alt9, Alt10, Alt11, Alt12, Alt13, Alt14, Alt15, Alt16> Alt<I, Output, Error> for (Alt2, Alt3, Alt4, Alt5, Alt6, Alt7, Alt8, Alt9, Alt10, Alt11, Alt12, Alt13, Alt14, Alt15, Alt16)
where I: Stream, 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>,

§

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

§

impl<I, Output, Error, Alt2, Alt3, Alt4, Alt5, Alt6, Alt7, Alt8, Alt9, Alt10, Alt11, Alt12, Alt13, Alt14, Alt15, Alt16, Alt17> Alt<I, Output, Error> for (Alt2, Alt3, Alt4, Alt5, Alt6, Alt7, Alt8, Alt9, Alt10, Alt11, Alt12, Alt13, Alt14, Alt15, Alt16, Alt17)
where I: Stream, 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>,

§

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

§

impl<I, Output, Error, Alt2, Alt3, Alt4, Alt5, Alt6, Alt7, Alt8, Alt9, Alt10, Alt11, Alt12, Alt13, Alt14, Alt15, Alt16, Alt17, Alt18> Alt<I, Output, Error> for (Alt2, Alt3, Alt4, Alt5, Alt6, Alt7, Alt8, Alt9, Alt10, Alt11, Alt12, Alt13, Alt14, Alt15, Alt16, Alt17, Alt18)
where I: Stream, 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>,

§

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

§

impl<I, Output, Error, Alt2, Alt3, Alt4, Alt5, Alt6, Alt7, Alt8, Alt9, Alt10, Alt11, Alt12, Alt13, Alt14, Alt15, Alt16, Alt17, Alt18, Alt19> Alt<I, Output, Error> for (Alt2, Alt3, Alt4, Alt5, Alt6, Alt7, Alt8, Alt9, Alt10, Alt11, Alt12, Alt13, Alt14, Alt15, Alt16, Alt17, Alt18, Alt19)
where I: Stream, 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>,

§

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

§

impl<I, Output, Error, Alt2, Alt3, Alt4, Alt5, Alt6, Alt7, Alt8, Alt9, Alt10, Alt11, Alt12, Alt13, Alt14, Alt15, Alt16, Alt17, Alt18, Alt19, Alt20> Alt<I, Output, Error> for (Alt2, Alt3, Alt4, Alt5, Alt6, Alt7, Alt8, Alt9, Alt10, Alt11, Alt12, Alt13, Alt14, Alt15, Alt16, Alt17, Alt18, Alt19, Alt20)
where I: Stream, 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>,

§

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

§

impl<I, Output, Error, Alt2, Alt3, Alt4, Alt5, Alt6, Alt7, Alt8, Alt9, Alt10, Alt11, Alt12, Alt13, Alt14, Alt15, Alt16, Alt17, Alt18, Alt19, Alt20, Alt21> 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)
where I: Stream, 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>,

§

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

§

impl<I, Output, Error, Alt2, Alt3, Alt4, Alt5, Alt6, Alt7, Alt8, Alt9, Alt10, Alt11, Alt12, Alt13, Alt14, Alt15, Alt16, Alt17, Alt18, Alt19, Alt20, Alt21, Alt22> 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)
where I: Stream, 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>,

§

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

§

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

§

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

Implementors§