pub trait ChoiceParser {
type Input: Stream;
type Output;
type PartialState: Default;
// Required methods
fn parse_first(
&mut self,
input: &mut Self::Input,
state: &mut Self::PartialState,
) -> ConsumedResult<Self::Output, Self::Input>;
fn parse_partial(
&mut self,
input: &mut Self::Input,
state: &mut Self::PartialState,
) -> ConsumedResult<Self::Output, Self::Input>;
fn parse_mode_choice<M>(
&mut self,
mode: M,
input: &mut Self::Input,
state: &mut Self::PartialState,
) -> ConsumedResult<Self::Output, Self::Input>
where M: ParseMode,
Self: Sized;
fn add_error_choice(
&mut self,
error: &mut Tracked<<Self::Input as StreamOnce>::Error>,
);
}
Expand description
ChoiceParser
represents a parser which may parse one of several different choices depending
on the input.
This is an internal trait used to overload the choice
function.