Struct Choice

Source
pub struct Choice<T: IntoChoice<O>, O> { /* private fields */ }

Implementations§

Source§

impl<T: IntoChoice<O>, O> Choice<T, O>

Source

pub const fn new(parsers: T) -> Self

Trait Implementations§

Source§

impl<T, O> Clone for Choice<T, O>
where T: Clone + IntoChoice<O>, PhantomData<O>: Clone,

Source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<A: Parser<Output>, B: Parser<Output>, C: Parser<Output>, D: Parser<Output>, E: Parser<Output>, F: Parser<Output>, G: Parser<Output>, H: Parser<Output>, I: Parser<Output>, J: Parser<Output>, K: Parser<Output>, L: Parser<Output>, M: Parser<Output>, N: Parser<Output>, O: Parser<Output>, P: Parser<Output>, Q: Parser<Output>, R: Parser<Output>, S: Parser<Output>, T: Parser<Output>, U: Parser<Output>, V: Parser<Output>, W: Parser<Output>, X: Parser<Output>, Y: Parser<Output>, Z: Parser<Output>, Output> Parser<Output> for Choice<(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z), Output>

Source§

fn parse_inner(&self, input: &mut ParserInput<'_>) -> ParserResult<Output>

Inner parsing function, to implement
Source§

fn parse(&self, input: &mut ParserInput<'_>) -> ParserResult<T>

Parse an input with the current parser Read more
Source§

fn parse_str(&self, str: &str) -> ParserResult<T>

Parse a string Read more
Source§

fn parse_str_with_file_id(&self, str: &str, file_id: FileId) -> ParserResult<T>

Parse a string as a file Read more
Source§

fn then<U, P: Parser<U>>(self, other: P) -> Then<T, Self, U, P>
where Self: Sized,

Chain this parser with another, getting both parsers’ results combined
Source§

fn then_ignore<U, P: Parser<U>>(self, other: P) -> ThenIgnore<T, Self, U, P>
where Self: Sized,

Chain this parser with another but discard the latter’s parsed value
Source§

fn ignore_then<U, P: Parser<U>>(self, other: P) -> IgnoreThen<T, Self, U, P>
where Self: Sized,

Chain this parser with another but discard the former’s parsed value
Source§

fn followed_by<U, P: Parser<U>>(self, other: P) -> FollowedBy<T, Self, U, P>
where Self: Sized,

Only match if this parser succeeds and the provided parser succeeds as well Read more
Source§

fn not_followed_by<U, P: Parser<U>>( self, other: P, ) -> NotFollowedBy<T, Self, U, P>
where Self: Sized,

Only match if this parser succeeds and the provided parser doesn’t
Source§

fn repeated(self) -> Repeated<T, Self, NoAllocContainer>
where Self: Sized,

Parse as many times as possible, until the parser eventually fails Read more
Source§

fn repeated_into_vec(self) -> Repeated<T, Self, Vec<T>>
where Self: Sized,

Parse as many times as possible, until the parser eventually fails Read more
Source§

fn repeated_into_container<C: Container<T>>(self) -> Repeated<T, Self, C>
where Self: Sized,

Parse as many times as possible, until the parser eventually fails Read more
Source§

fn or_not(self) -> OrNot<T, Self>
where Self: Sized,

Try to parse Read more
Source§

fn map<U, F: Fn(T) -> U>(self, mapper: F) -> Map<T, Self, U, F>
where Self: Sized,

Map the parsed value using a function Read more
Source§

fn map_str<U, F: Fn(&str) -> U>(self, mapper: F) -> MapStr<T, Self, U, F>
where Self: Sized,

Get the input string matched by the parser and map it using a function
Source§

fn try_map<U, F: Fn(T) -> Option<U>>(self, mapper: F) -> TryMap<T, Self, U, F>
where Self: Sized,

Try to map the parsed value using a function
Source§

fn and_then<U, F: Fn(T) -> Result<U, ParsingError>>( self, mapper: F, ) -> AndThen<T, Self, U, F>
where Self: Sized,

Transform and validate the parsed value using the provided function Read more
Source§

fn and_then_or_critical<U, F: Fn(T) -> Result<U, Cow<'static, str>>>( self, mapper: F, ) -> AndThenOrCritical<T, Self, U, F>
where Self: Sized,

Transform and validate the parsed value using the provided function Failures are critical
Source§

fn spanned(self) -> Spanned<T, Self>
where Self: Sized,

Wrap the parsed value in a Spanned
Source§

fn collect<C>(self) -> Map<T, Self, C, fn(T) -> C>
where Self: Sized, T: IntoIterator, C: FromIterator<T::Item>,

Collect the parsed value using the provided iterator type
Source§

fn collect_string(self) -> StringCollected<T, Self>
where Self: Sized,

Collect the input string matched by the parser
Source§

fn atomic_err(self, message: &'static str) -> AtomicErr<T, Self>
where Self: Sized,

Provide an atomic error if the parser fails Read more
Source§

fn critical(self, message: &'static str) -> Critical<T, Self>
where Self: Sized,

Mark the parser as critical Read more
Source§

fn critical_auto_msg(self) -> Critical<T, Self>
where Self: Sized,

Mark the parser as critical Read more
Source§

fn silent(self) -> Silenced<T, Self>
where Self: Sized,

Make the parser silent Read more
Source§

fn padded_by<P, PP: Parser<P>>(self, padding: PP) -> Padded<T, Self, P, PP>
where Self: Sized,

Require the parser to be preceded by and followed by the provided padding Read more
Source§

fn line_padded(self) -> LinePadded<T, Self>
where Self: Sized,

Allow the parser to be surrounded by whitespaces (not newlines)
Source§

fn surrounded_by<L, LP: Parser<L>, R, RP: Parser<R>>( self, left: LP, right: RP, ) -> SurroundedBy<L, LP, T, Self, R, RP>
where Self: Sized,

Require the parser to be preceded by and followed by the provided parsers Read more
Source§

fn separated_by<S, P: Parser<S>>( self, sep: P, ) -> SeparatedBy<T, Self, S, P, NoAllocContainer>
where Self: Sized,

Repeat the parser with the required provided separator between each repetition Read more
Source§

fn separated_by_into_vec<S, P: Parser<S>>( self, sep: P, ) -> SeparatedBy<T, Self, S, P, Vec<T>>
where Self: Sized,

Repeat the parser with the required provided separator between each repetition Read more
Source§

fn separated_by_into_container<C: Container<T>, S, P: Parser<S>>( self, sep: P, ) -> SeparatedBy<T, Self, S, P, C>
where Self: Sized,

Repeat the parser with the required provided separator between each repetition Read more
Source§

fn flatten<U, S>(self) -> Flattened<U, S, T, Self, NoAllocContainer>
where Self: Sized, T: IntoIterator<Item = S>, S: IntoIterator<Item = U>,

Flatten the parser Read more
Source§

fn flatten_into_vec<U, S>(self) -> Flattened<U, S, T, Self, Vec<U>>
where Self: Sized, T: IntoIterator<Item = S>, S: IntoIterator<Item = U>,

Flatten the parser Requires the parser to return a nested iterator. Read more
Source§

fn flatten_into_container<U, S, C: Container<U>>( self, ) -> Flattened<U, S, T, Self, C>
where Self: Sized, T: IntoIterator<Item = S>, S: IntoIterator<Item = U>,

Flatten the parser Requires the parser to return a nested iterator. Read more
Source§

fn to<U: Copy>(self, data: U) -> To<T, Self, U>
where Self: Sized,

Discard the parsed value and replace it with a fixed value
Source§

fn full(self) -> Full<T, Self>
where Self: Sized,

Require the parser to match the entire input
Source§

fn or<P: Parser<T>>(self, other: P) -> Choice<(Self, P), T>
where Self: Sized,

Allow the parser to fallback to another parser in case of failure Read more
Source§

fn validate<F: Fn(&T) -> bool>(self, validator: F) -> Validate<T, Self, F>
where Self: Sized,

Validate the parsed value with a predicate
Source§

fn validate_or_critical<F: Fn(&T) -> bool>( self, validator: F, message: &'static str, ) -> ValidateOrCriticalMsg<T, Self, F>
where Self: Sized,

Validate the parsed value with a predicate or return a provided critical error message Read more
Source§

fn validate_or_dynamic_critical<F: Fn(&T) -> Result<(), Cow<'static, str>>>( self, validator: F, ) -> ValidateOrDynamicCriticalMsg<T, Self, F>
where Self: Sized,

Validate the parsed value with a predicate or return a critical error message Read more
Source§

fn debug<F: for<'a, 'b> Fn(DebugType<'a, 'b, T>)>( self, debugger: F, ) -> Debugging<T, Self, F>
where Self: Sized,

Debug the input and output values of the parser using the provided debugger
Source§

fn erase_type(self) -> Box<dyn Parser<T> + Send + Sync>
where Self: Sized + Send + Sync + 'static,

“Erase” the parser’s type Read more
Source§

fn static_ref(&'static self) -> StaticRef<T, Self>
where Self: Sized,

Wrap a static reference to this parser inside a new parser Read more
Source§

impl<B: Parser<Output>, C: Parser<Output>, D: Parser<Output>, E: Parser<Output>, F: Parser<Output>, G: Parser<Output>, H: Parser<Output>, I: Parser<Output>, J: Parser<Output>, K: Parser<Output>, L: Parser<Output>, M: Parser<Output>, N: Parser<Output>, O: Parser<Output>, P: Parser<Output>, Q: Parser<Output>, R: Parser<Output>, S: Parser<Output>, T: Parser<Output>, U: Parser<Output>, V: Parser<Output>, W: Parser<Output>, X: Parser<Output>, Y: Parser<Output>, Z: Parser<Output>, Output> Parser<Output> for Choice<(B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z), Output>

Source§

fn parse_inner(&self, input: &mut ParserInput<'_>) -> ParserResult<Output>

Inner parsing function, to implement
Source§

fn parse(&self, input: &mut ParserInput<'_>) -> ParserResult<T>

Parse an input with the current parser Read more
Source§

fn parse_str(&self, str: &str) -> ParserResult<T>

Parse a string Read more
Source§

fn parse_str_with_file_id(&self, str: &str, file_id: FileId) -> ParserResult<T>

Parse a string as a file Read more
Source§

fn then<U, P: Parser<U>>(self, other: P) -> Then<T, Self, U, P>
where Self: Sized,

Chain this parser with another, getting both parsers’ results combined
Source§

fn then_ignore<U, P: Parser<U>>(self, other: P) -> ThenIgnore<T, Self, U, P>
where Self: Sized,

Chain this parser with another but discard the latter’s parsed value
Source§

fn ignore_then<U, P: Parser<U>>(self, other: P) -> IgnoreThen<T, Self, U, P>
where Self: Sized,

Chain this parser with another but discard the former’s parsed value
Source§

fn followed_by<U, P: Parser<U>>(self, other: P) -> FollowedBy<T, Self, U, P>
where Self: Sized,

Only match if this parser succeeds and the provided parser succeeds as well Read more
Source§

fn not_followed_by<U, P: Parser<U>>( self, other: P, ) -> NotFollowedBy<T, Self, U, P>
where Self: Sized,

Only match if this parser succeeds and the provided parser doesn’t
Source§

fn repeated(self) -> Repeated<T, Self, NoAllocContainer>
where Self: Sized,

Parse as many times as possible, until the parser eventually fails Read more
Source§

fn repeated_into_vec(self) -> Repeated<T, Self, Vec<T>>
where Self: Sized,

Parse as many times as possible, until the parser eventually fails Read more
Source§

fn repeated_into_container<C: Container<T>>(self) -> Repeated<T, Self, C>
where Self: Sized,

Parse as many times as possible, until the parser eventually fails Read more
Source§

fn or_not(self) -> OrNot<T, Self>
where Self: Sized,

Try to parse Read more
Source§

fn map<U, F: Fn(T) -> U>(self, mapper: F) -> Map<T, Self, U, F>
where Self: Sized,

Map the parsed value using a function Read more
Source§

fn map_str<U, F: Fn(&str) -> U>(self, mapper: F) -> MapStr<T, Self, U, F>
where Self: Sized,

Get the input string matched by the parser and map it using a function
Source§

fn try_map<U, F: Fn(T) -> Option<U>>(self, mapper: F) -> TryMap<T, Self, U, F>
where Self: Sized,

Try to map the parsed value using a function
Source§

fn and_then<U, F: Fn(T) -> Result<U, ParsingError>>( self, mapper: F, ) -> AndThen<T, Self, U, F>
where Self: Sized,

Transform and validate the parsed value using the provided function Read more
Source§

fn and_then_or_critical<U, F: Fn(T) -> Result<U, Cow<'static, str>>>( self, mapper: F, ) -> AndThenOrCritical<T, Self, U, F>
where Self: Sized,

Transform and validate the parsed value using the provided function Failures are critical
Source§

fn spanned(self) -> Spanned<T, Self>
where Self: Sized,

Wrap the parsed value in a Spanned
Source§

fn collect<C>(self) -> Map<T, Self, C, fn(T) -> C>
where Self: Sized, T: IntoIterator, C: FromIterator<T::Item>,

Collect the parsed value using the provided iterator type
Source§

fn collect_string(self) -> StringCollected<T, Self>
where Self: Sized,

Collect the input string matched by the parser
Source§

fn atomic_err(self, message: &'static str) -> AtomicErr<T, Self>
where Self: Sized,

Provide an atomic error if the parser fails Read more
Source§

fn critical(self, message: &'static str) -> Critical<T, Self>
where Self: Sized,

Mark the parser as critical Read more
Source§

fn critical_auto_msg(self) -> Critical<T, Self>
where Self: Sized,

Mark the parser as critical Read more
Source§

fn silent(self) -> Silenced<T, Self>
where Self: Sized,

Make the parser silent Read more
Source§

fn padded_by<P, PP: Parser<P>>(self, padding: PP) -> Padded<T, Self, P, PP>
where Self: Sized,

Require the parser to be preceded by and followed by the provided padding Read more
Source§

fn line_padded(self) -> LinePadded<T, Self>
where Self: Sized,

Allow the parser to be surrounded by whitespaces (not newlines)
Source§

fn surrounded_by<L, LP: Parser<L>, R, RP: Parser<R>>( self, left: LP, right: RP, ) -> SurroundedBy<L, LP, T, Self, R, RP>
where Self: Sized,

Require the parser to be preceded by and followed by the provided parsers Read more
Source§

fn separated_by<S, P: Parser<S>>( self, sep: P, ) -> SeparatedBy<T, Self, S, P, NoAllocContainer>
where Self: Sized,

Repeat the parser with the required provided separator between each repetition Read more
Source§

fn separated_by_into_vec<S, P: Parser<S>>( self, sep: P, ) -> SeparatedBy<T, Self, S, P, Vec<T>>
where Self: Sized,

Repeat the parser with the required provided separator between each repetition Read more
Source§

fn separated_by_into_container<C: Container<T>, S, P: Parser<S>>( self, sep: P, ) -> SeparatedBy<T, Self, S, P, C>
where Self: Sized,

Repeat the parser with the required provided separator between each repetition Read more
Source§

fn flatten<U, S>(self) -> Flattened<U, S, T, Self, NoAllocContainer>
where Self: Sized, T: IntoIterator<Item = S>, S: IntoIterator<Item = U>,

Flatten the parser Read more
Source§

fn flatten_into_vec<U, S>(self) -> Flattened<U, S, T, Self, Vec<U>>
where Self: Sized, T: IntoIterator<Item = S>, S: IntoIterator<Item = U>,

Flatten the parser Requires the parser to return a nested iterator. Read more
Source§

fn flatten_into_container<U, S, C: Container<U>>( self, ) -> Flattened<U, S, T, Self, C>
where Self: Sized, T: IntoIterator<Item = S>, S: IntoIterator<Item = U>,

Flatten the parser Requires the parser to return a nested iterator. Read more
Source§

fn to<U: Copy>(self, data: U) -> To<T, Self, U>
where Self: Sized,

Discard the parsed value and replace it with a fixed value
Source§

fn full(self) -> Full<T, Self>
where Self: Sized,

Require the parser to match the entire input
Source§

fn or<P: Parser<T>>(self, other: P) -> Choice<(Self, P), T>
where Self: Sized,

Allow the parser to fallback to another parser in case of failure Read more
Source§

fn validate<F: Fn(&T) -> bool>(self, validator: F) -> Validate<T, Self, F>
where Self: Sized,

Validate the parsed value with a predicate
Source§

fn validate_or_critical<F: Fn(&T) -> bool>( self, validator: F, message: &'static str, ) -> ValidateOrCriticalMsg<T, Self, F>
where Self: Sized,

Validate the parsed value with a predicate or return a provided critical error message Read more
Source§

fn validate_or_dynamic_critical<F: Fn(&T) -> Result<(), Cow<'static, str>>>( self, validator: F, ) -> ValidateOrDynamicCriticalMsg<T, Self, F>
where Self: Sized,

Validate the parsed value with a predicate or return a critical error message Read more
Source§

fn debug<F: for<'a, 'b> Fn(DebugType<'a, 'b, T>)>( self, debugger: F, ) -> Debugging<T, Self, F>
where Self: Sized,

Debug the input and output values of the parser using the provided debugger
Source§

fn erase_type(self) -> Box<dyn Parser<T> + Send + Sync>
where Self: Sized + Send + Sync + 'static,

“Erase” the parser’s type Read more
Source§

fn static_ref(&'static self) -> StaticRef<T, Self>
where Self: Sized,

Wrap a static reference to this parser inside a new parser Read more
Source§

impl<C: Parser<Output>, D: Parser<Output>, E: Parser<Output>, F: Parser<Output>, G: Parser<Output>, H: Parser<Output>, I: Parser<Output>, J: Parser<Output>, K: Parser<Output>, L: Parser<Output>, M: Parser<Output>, N: Parser<Output>, O: Parser<Output>, P: Parser<Output>, Q: Parser<Output>, R: Parser<Output>, S: Parser<Output>, T: Parser<Output>, U: Parser<Output>, V: Parser<Output>, W: Parser<Output>, X: Parser<Output>, Y: Parser<Output>, Z: Parser<Output>, Output> Parser<Output> for Choice<(C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z), Output>

Source§

fn parse_inner(&self, input: &mut ParserInput<'_>) -> ParserResult<Output>

Inner parsing function, to implement
Source§

fn parse(&self, input: &mut ParserInput<'_>) -> ParserResult<T>

Parse an input with the current parser Read more
Source§

fn parse_str(&self, str: &str) -> ParserResult<T>

Parse a string Read more
Source§

fn parse_str_with_file_id(&self, str: &str, file_id: FileId) -> ParserResult<T>

Parse a string as a file Read more
Source§

fn then<U, P: Parser<U>>(self, other: P) -> Then<T, Self, U, P>
where Self: Sized,

Chain this parser with another, getting both parsers’ results combined
Source§

fn then_ignore<U, P: Parser<U>>(self, other: P) -> ThenIgnore<T, Self, U, P>
where Self: Sized,

Chain this parser with another but discard the latter’s parsed value
Source§

fn ignore_then<U, P: Parser<U>>(self, other: P) -> IgnoreThen<T, Self, U, P>
where Self: Sized,

Chain this parser with another but discard the former’s parsed value
Source§

fn followed_by<U, P: Parser<U>>(self, other: P) -> FollowedBy<T, Self, U, P>
where Self: Sized,

Only match if this parser succeeds and the provided parser succeeds as well Read more
Source§

fn not_followed_by<U, P: Parser<U>>( self, other: P, ) -> NotFollowedBy<T, Self, U, P>
where Self: Sized,

Only match if this parser succeeds and the provided parser doesn’t
Source§

fn repeated(self) -> Repeated<T, Self, NoAllocContainer>
where Self: Sized,

Parse as many times as possible, until the parser eventually fails Read more
Source§

fn repeated_into_vec(self) -> Repeated<T, Self, Vec<T>>
where Self: Sized,

Parse as many times as possible, until the parser eventually fails Read more
Source§

fn repeated_into_container<C: Container<T>>(self) -> Repeated<T, Self, C>
where Self: Sized,

Parse as many times as possible, until the parser eventually fails Read more
Source§

fn or_not(self) -> OrNot<T, Self>
where Self: Sized,

Try to parse Read more
Source§

fn map<U, F: Fn(T) -> U>(self, mapper: F) -> Map<T, Self, U, F>
where Self: Sized,

Map the parsed value using a function Read more
Source§

fn map_str<U, F: Fn(&str) -> U>(self, mapper: F) -> MapStr<T, Self, U, F>
where Self: Sized,

Get the input string matched by the parser and map it using a function
Source§

fn try_map<U, F: Fn(T) -> Option<U>>(self, mapper: F) -> TryMap<T, Self, U, F>
where Self: Sized,

Try to map the parsed value using a function
Source§

fn and_then<U, F: Fn(T) -> Result<U, ParsingError>>( self, mapper: F, ) -> AndThen<T, Self, U, F>
where Self: Sized,

Transform and validate the parsed value using the provided function Read more
Source§

fn and_then_or_critical<U, F: Fn(T) -> Result<U, Cow<'static, str>>>( self, mapper: F, ) -> AndThenOrCritical<T, Self, U, F>
where Self: Sized,

Transform and validate the parsed value using the provided function Failures are critical
Source§

fn spanned(self) -> Spanned<T, Self>
where Self: Sized,

Wrap the parsed value in a Spanned
Source§

fn collect<C>(self) -> Map<T, Self, C, fn(T) -> C>
where Self: Sized, T: IntoIterator, C: FromIterator<T::Item>,

Collect the parsed value using the provided iterator type
Source§

fn collect_string(self) -> StringCollected<T, Self>
where Self: Sized,

Collect the input string matched by the parser
Source§

fn atomic_err(self, message: &'static str) -> AtomicErr<T, Self>
where Self: Sized,

Provide an atomic error if the parser fails Read more
Source§

fn critical(self, message: &'static str) -> Critical<T, Self>
where Self: Sized,

Mark the parser as critical Read more
Source§

fn critical_auto_msg(self) -> Critical<T, Self>
where Self: Sized,

Mark the parser as critical Read more
Source§

fn silent(self) -> Silenced<T, Self>
where Self: Sized,

Make the parser silent Read more
Source§

fn padded_by<P, PP: Parser<P>>(self, padding: PP) -> Padded<T, Self, P, PP>
where Self: Sized,

Require the parser to be preceded by and followed by the provided padding Read more
Source§

fn line_padded(self) -> LinePadded<T, Self>
where Self: Sized,

Allow the parser to be surrounded by whitespaces (not newlines)
Source§

fn surrounded_by<L, LP: Parser<L>, R, RP: Parser<R>>( self, left: LP, right: RP, ) -> SurroundedBy<L, LP, T, Self, R, RP>
where Self: Sized,

Require the parser to be preceded by and followed by the provided parsers Read more
Source§

fn separated_by<S, P: Parser<S>>( self, sep: P, ) -> SeparatedBy<T, Self, S, P, NoAllocContainer>
where Self: Sized,

Repeat the parser with the required provided separator between each repetition Read more
Source§

fn separated_by_into_vec<S, P: Parser<S>>( self, sep: P, ) -> SeparatedBy<T, Self, S, P, Vec<T>>
where Self: Sized,

Repeat the parser with the required provided separator between each repetition Read more
Source§

fn separated_by_into_container<C: Container<T>, S, P: Parser<S>>( self, sep: P, ) -> SeparatedBy<T, Self, S, P, C>
where Self: Sized,

Repeat the parser with the required provided separator between each repetition Read more
Source§

fn flatten<U, S>(self) -> Flattened<U, S, T, Self, NoAllocContainer>
where Self: Sized, T: IntoIterator<Item = S>, S: IntoIterator<Item = U>,

Flatten the parser Read more
Source§

fn flatten_into_vec<U, S>(self) -> Flattened<U, S, T, Self, Vec<U>>
where Self: Sized, T: IntoIterator<Item = S>, S: IntoIterator<Item = U>,

Flatten the parser Requires the parser to return a nested iterator. Read more
Source§

fn flatten_into_container<U, S, C: Container<U>>( self, ) -> Flattened<U, S, T, Self, C>
where Self: Sized, T: IntoIterator<Item = S>, S: IntoIterator<Item = U>,

Flatten the parser Requires the parser to return a nested iterator. Read more
Source§

fn to<U: Copy>(self, data: U) -> To<T, Self, U>
where Self: Sized,

Discard the parsed value and replace it with a fixed value
Source§

fn full(self) -> Full<T, Self>
where Self: Sized,

Require the parser to match the entire input
Source§

fn or<P: Parser<T>>(self, other: P) -> Choice<(Self, P), T>
where Self: Sized,

Allow the parser to fallback to another parser in case of failure Read more
Source§

fn validate<F: Fn(&T) -> bool>(self, validator: F) -> Validate<T, Self, F>
where Self: Sized,

Validate the parsed value with a predicate
Source§

fn validate_or_critical<F: Fn(&T) -> bool>( self, validator: F, message: &'static str, ) -> ValidateOrCriticalMsg<T, Self, F>
where Self: Sized,

Validate the parsed value with a predicate or return a provided critical error message Read more
Source§

fn validate_or_dynamic_critical<F: Fn(&T) -> Result<(), Cow<'static, str>>>( self, validator: F, ) -> ValidateOrDynamicCriticalMsg<T, Self, F>
where Self: Sized,

Validate the parsed value with a predicate or return a critical error message Read more
Source§

fn debug<F: for<'a, 'b> Fn(DebugType<'a, 'b, T>)>( self, debugger: F, ) -> Debugging<T, Self, F>
where Self: Sized,

Debug the input and output values of the parser using the provided debugger
Source§

fn erase_type(self) -> Box<dyn Parser<T> + Send + Sync>
where Self: Sized + Send + Sync + 'static,

“Erase” the parser’s type Read more
Source§

fn static_ref(&'static self) -> StaticRef<T, Self>
where Self: Sized,

Wrap a static reference to this parser inside a new parser Read more
Source§

impl<D: Parser<Output>, E: Parser<Output>, F: Parser<Output>, G: Parser<Output>, H: Parser<Output>, I: Parser<Output>, J: Parser<Output>, K: Parser<Output>, L: Parser<Output>, M: Parser<Output>, N: Parser<Output>, O: Parser<Output>, P: Parser<Output>, Q: Parser<Output>, R: Parser<Output>, S: Parser<Output>, T: Parser<Output>, U: Parser<Output>, V: Parser<Output>, W: Parser<Output>, X: Parser<Output>, Y: Parser<Output>, Z: Parser<Output>, Output> Parser<Output> for Choice<(D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z), Output>

Source§

fn parse_inner(&self, input: &mut ParserInput<'_>) -> ParserResult<Output>

Inner parsing function, to implement
Source§

fn parse(&self, input: &mut ParserInput<'_>) -> ParserResult<T>

Parse an input with the current parser Read more
Source§

fn parse_str(&self, str: &str) -> ParserResult<T>

Parse a string Read more
Source§

fn parse_str_with_file_id(&self, str: &str, file_id: FileId) -> ParserResult<T>

Parse a string as a file Read more
Source§

fn then<U, P: Parser<U>>(self, other: P) -> Then<T, Self, U, P>
where Self: Sized,

Chain this parser with another, getting both parsers’ results combined
Source§

fn then_ignore<U, P: Parser<U>>(self, other: P) -> ThenIgnore<T, Self, U, P>
where Self: Sized,

Chain this parser with another but discard the latter’s parsed value
Source§

fn ignore_then<U, P: Parser<U>>(self, other: P) -> IgnoreThen<T, Self, U, P>
where Self: Sized,

Chain this parser with another but discard the former’s parsed value
Source§

fn followed_by<U, P: Parser<U>>(self, other: P) -> FollowedBy<T, Self, U, P>
where Self: Sized,

Only match if this parser succeeds and the provided parser succeeds as well Read more
Source§

fn not_followed_by<U, P: Parser<U>>( self, other: P, ) -> NotFollowedBy<T, Self, U, P>
where Self: Sized,

Only match if this parser succeeds and the provided parser doesn’t
Source§

fn repeated(self) -> Repeated<T, Self, NoAllocContainer>
where Self: Sized,

Parse as many times as possible, until the parser eventually fails Read more
Source§

fn repeated_into_vec(self) -> Repeated<T, Self, Vec<T>>
where Self: Sized,

Parse as many times as possible, until the parser eventually fails Read more
Source§

fn repeated_into_container<C: Container<T>>(self) -> Repeated<T, Self, C>
where Self: Sized,

Parse as many times as possible, until the parser eventually fails Read more
Source§

fn or_not(self) -> OrNot<T, Self>
where Self: Sized,

Try to parse Read more
Source§

fn map<U, F: Fn(T) -> U>(self, mapper: F) -> Map<T, Self, U, F>
where Self: Sized,

Map the parsed value using a function Read more
Source§

fn map_str<U, F: Fn(&str) -> U>(self, mapper: F) -> MapStr<T, Self, U, F>
where Self: Sized,

Get the input string matched by the parser and map it using a function
Source§

fn try_map<U, F: Fn(T) -> Option<U>>(self, mapper: F) -> TryMap<T, Self, U, F>
where Self: Sized,

Try to map the parsed value using a function
Source§

fn and_then<U, F: Fn(T) -> Result<U, ParsingError>>( self, mapper: F, ) -> AndThen<T, Self, U, F>
where Self: Sized,

Transform and validate the parsed value using the provided function Read more
Source§

fn and_then_or_critical<U, F: Fn(T) -> Result<U, Cow<'static, str>>>( self, mapper: F, ) -> AndThenOrCritical<T, Self, U, F>
where Self: Sized,

Transform and validate the parsed value using the provided function Failures are critical
Source§

fn spanned(self) -> Spanned<T, Self>
where Self: Sized,

Wrap the parsed value in a Spanned
Source§

fn collect<C>(self) -> Map<T, Self, C, fn(T) -> C>
where Self: Sized, T: IntoIterator, C: FromIterator<T::Item>,

Collect the parsed value using the provided iterator type
Source§

fn collect_string(self) -> StringCollected<T, Self>
where Self: Sized,

Collect the input string matched by the parser
Source§

fn atomic_err(self, message: &'static str) -> AtomicErr<T, Self>
where Self: Sized,

Provide an atomic error if the parser fails Read more
Source§

fn critical(self, message: &'static str) -> Critical<T, Self>
where Self: Sized,

Mark the parser as critical Read more
Source§

fn critical_auto_msg(self) -> Critical<T, Self>
where Self: Sized,

Mark the parser as critical Read more
Source§

fn silent(self) -> Silenced<T, Self>
where Self: Sized,

Make the parser silent Read more
Source§

fn padded_by<P, PP: Parser<P>>(self, padding: PP) -> Padded<T, Self, P, PP>
where Self: Sized,

Require the parser to be preceded by and followed by the provided padding Read more
Source§

fn line_padded(self) -> LinePadded<T, Self>
where Self: Sized,

Allow the parser to be surrounded by whitespaces (not newlines)
Source§

fn surrounded_by<L, LP: Parser<L>, R, RP: Parser<R>>( self, left: LP, right: RP, ) -> SurroundedBy<L, LP, T, Self, R, RP>
where Self: Sized,

Require the parser to be preceded by and followed by the provided parsers Read more
Source§

fn separated_by<S, P: Parser<S>>( self, sep: P, ) -> SeparatedBy<T, Self, S, P, NoAllocContainer>
where Self: Sized,

Repeat the parser with the required provided separator between each repetition Read more
Source§

fn separated_by_into_vec<S, P: Parser<S>>( self, sep: P, ) -> SeparatedBy<T, Self, S, P, Vec<T>>
where Self: Sized,

Repeat the parser with the required provided separator between each repetition Read more
Source§

fn separated_by_into_container<C: Container<T>, S, P: Parser<S>>( self, sep: P, ) -> SeparatedBy<T, Self, S, P, C>
where Self: Sized,

Repeat the parser with the required provided separator between each repetition Read more
Source§

fn flatten<U, S>(self) -> Flattened<U, S, T, Self, NoAllocContainer>
where Self: Sized, T: IntoIterator<Item = S>, S: IntoIterator<Item = U>,

Flatten the parser Read more
Source§

fn flatten_into_vec<U, S>(self) -> Flattened<U, S, T, Self, Vec<U>>
where Self: Sized, T: IntoIterator<Item = S>, S: IntoIterator<Item = U>,

Flatten the parser Requires the parser to return a nested iterator. Read more
Source§

fn flatten_into_container<U, S, C: Container<U>>( self, ) -> Flattened<U, S, T, Self, C>
where Self: Sized, T: IntoIterator<Item = S>, S: IntoIterator<Item = U>,

Flatten the parser Requires the parser to return a nested iterator. Read more
Source§

fn to<U: Copy>(self, data: U) -> To<T, Self, U>
where Self: Sized,

Discard the parsed value and replace it with a fixed value
Source§

fn full(self) -> Full<T, Self>
where Self: Sized,

Require the parser to match the entire input
Source§

fn or<P: Parser<T>>(self, other: P) -> Choice<(Self, P), T>
where Self: Sized,

Allow the parser to fallback to another parser in case of failure Read more
Source§

fn validate<F: Fn(&T) -> bool>(self, validator: F) -> Validate<T, Self, F>
where Self: Sized,

Validate the parsed value with a predicate
Source§

fn validate_or_critical<F: Fn(&T) -> bool>( self, validator: F, message: &'static str, ) -> ValidateOrCriticalMsg<T, Self, F>
where Self: Sized,

Validate the parsed value with a predicate or return a provided critical error message Read more
Source§

fn validate_or_dynamic_critical<F: Fn(&T) -> Result<(), Cow<'static, str>>>( self, validator: F, ) -> ValidateOrDynamicCriticalMsg<T, Self, F>
where Self: Sized,

Validate the parsed value with a predicate or return a critical error message Read more
Source§

fn debug<F: for<'a, 'b> Fn(DebugType<'a, 'b, T>)>( self, debugger: F, ) -> Debugging<T, Self, F>
where Self: Sized,

Debug the input and output values of the parser using the provided debugger
Source§

fn erase_type(self) -> Box<dyn Parser<T> + Send + Sync>
where Self: Sized + Send + Sync + 'static,

“Erase” the parser’s type Read more
Source§

fn static_ref(&'static self) -> StaticRef<T, Self>
where Self: Sized,

Wrap a static reference to this parser inside a new parser Read more
Source§

impl<E: Parser<Output>, F: Parser<Output>, G: Parser<Output>, H: Parser<Output>, I: Parser<Output>, J: Parser<Output>, K: Parser<Output>, L: Parser<Output>, M: Parser<Output>, N: Parser<Output>, O: Parser<Output>, P: Parser<Output>, Q: Parser<Output>, R: Parser<Output>, S: Parser<Output>, T: Parser<Output>, U: Parser<Output>, V: Parser<Output>, W: Parser<Output>, X: Parser<Output>, Y: Parser<Output>, Z: Parser<Output>, Output> Parser<Output> for Choice<(E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z), Output>

Source§

fn parse_inner(&self, input: &mut ParserInput<'_>) -> ParserResult<Output>

Inner parsing function, to implement
Source§

fn parse(&self, input: &mut ParserInput<'_>) -> ParserResult<T>

Parse an input with the current parser Read more
Source§

fn parse_str(&self, str: &str) -> ParserResult<T>

Parse a string Read more
Source§

fn parse_str_with_file_id(&self, str: &str, file_id: FileId) -> ParserResult<T>

Parse a string as a file Read more
Source§

fn then<U, P: Parser<U>>(self, other: P) -> Then<T, Self, U, P>
where Self: Sized,

Chain this parser with another, getting both parsers’ results combined
Source§

fn then_ignore<U, P: Parser<U>>(self, other: P) -> ThenIgnore<T, Self, U, P>
where Self: Sized,

Chain this parser with another but discard the latter’s parsed value
Source§

fn ignore_then<U, P: Parser<U>>(self, other: P) -> IgnoreThen<T, Self, U, P>
where Self: Sized,

Chain this parser with another but discard the former’s parsed value
Source§

fn followed_by<U, P: Parser<U>>(self, other: P) -> FollowedBy<T, Self, U, P>
where Self: Sized,

Only match if this parser succeeds and the provided parser succeeds as well Read more
Source§

fn not_followed_by<U, P: Parser<U>>( self, other: P, ) -> NotFollowedBy<T, Self, U, P>
where Self: Sized,

Only match if this parser succeeds and the provided parser doesn’t
Source§

fn repeated(self) -> Repeated<T, Self, NoAllocContainer>
where Self: Sized,

Parse as many times as possible, until the parser eventually fails Read more
Source§

fn repeated_into_vec(self) -> Repeated<T, Self, Vec<T>>
where Self: Sized,

Parse as many times as possible, until the parser eventually fails Read more
Source§

fn repeated_into_container<C: Container<T>>(self) -> Repeated<T, Self, C>
where Self: Sized,

Parse as many times as possible, until the parser eventually fails Read more
Source§

fn or_not(self) -> OrNot<T, Self>
where Self: Sized,

Try to parse Read more
Source§

fn map<U, F: Fn(T) -> U>(self, mapper: F) -> Map<T, Self, U, F>
where Self: Sized,

Map the parsed value using a function Read more
Source§

fn map_str<U, F: Fn(&str) -> U>(self, mapper: F) -> MapStr<T, Self, U, F>
where Self: Sized,

Get the input string matched by the parser and map it using a function
Source§

fn try_map<U, F: Fn(T) -> Option<U>>(self, mapper: F) -> TryMap<T, Self, U, F>
where Self: Sized,

Try to map the parsed value using a function
Source§

fn and_then<U, F: Fn(T) -> Result<U, ParsingError>>( self, mapper: F, ) -> AndThen<T, Self, U, F>
where Self: Sized,

Transform and validate the parsed value using the provided function Read more
Source§

fn and_then_or_critical<U, F: Fn(T) -> Result<U, Cow<'static, str>>>( self, mapper: F, ) -> AndThenOrCritical<T, Self, U, F>
where Self: Sized,

Transform and validate the parsed value using the provided function Failures are critical
Source§

fn spanned(self) -> Spanned<T, Self>
where Self: Sized,

Wrap the parsed value in a Spanned
Source§

fn collect<C>(self) -> Map<T, Self, C, fn(T) -> C>
where Self: Sized, T: IntoIterator, C: FromIterator<T::Item>,

Collect the parsed value using the provided iterator type
Source§

fn collect_string(self) -> StringCollected<T, Self>
where Self: Sized,

Collect the input string matched by the parser
Source§

fn atomic_err(self, message: &'static str) -> AtomicErr<T, Self>
where Self: Sized,

Provide an atomic error if the parser fails Read more
Source§

fn critical(self, message: &'static str) -> Critical<T, Self>
where Self: Sized,

Mark the parser as critical Read more
Source§

fn critical_auto_msg(self) -> Critical<T, Self>
where Self: Sized,

Mark the parser as critical Read more
Source§

fn silent(self) -> Silenced<T, Self>
where Self: Sized,

Make the parser silent Read more
Source§

fn padded_by<P, PP: Parser<P>>(self, padding: PP) -> Padded<T, Self, P, PP>
where Self: Sized,

Require the parser to be preceded by and followed by the provided padding Read more
Source§

fn line_padded(self) -> LinePadded<T, Self>
where Self: Sized,

Allow the parser to be surrounded by whitespaces (not newlines)
Source§

fn surrounded_by<L, LP: Parser<L>, R, RP: Parser<R>>( self, left: LP, right: RP, ) -> SurroundedBy<L, LP, T, Self, R, RP>
where Self: Sized,

Require the parser to be preceded by and followed by the provided parsers Read more
Source§

fn separated_by<S, P: Parser<S>>( self, sep: P, ) -> SeparatedBy<T, Self, S, P, NoAllocContainer>
where Self: Sized,

Repeat the parser with the required provided separator between each repetition Read more
Source§

fn separated_by_into_vec<S, P: Parser<S>>( self, sep: P, ) -> SeparatedBy<T, Self, S, P, Vec<T>>
where Self: Sized,

Repeat the parser with the required provided separator between each repetition Read more
Source§

fn separated_by_into_container<C: Container<T>, S, P: Parser<S>>( self, sep: P, ) -> SeparatedBy<T, Self, S, P, C>
where Self: Sized,

Repeat the parser with the required provided separator between each repetition Read more
Source§

fn flatten<U, S>(self) -> Flattened<U, S, T, Self, NoAllocContainer>
where Self: Sized, T: IntoIterator<Item = S>, S: IntoIterator<Item = U>,

Flatten the parser Read more
Source§

fn flatten_into_vec<U, S>(self) -> Flattened<U, S, T, Self, Vec<U>>
where Self: Sized, T: IntoIterator<Item = S>, S: IntoIterator<Item = U>,

Flatten the parser Requires the parser to return a nested iterator. Read more
Source§

fn flatten_into_container<U, S, C: Container<U>>( self, ) -> Flattened<U, S, T, Self, C>
where Self: Sized, T: IntoIterator<Item = S>, S: IntoIterator<Item = U>,

Flatten the parser Requires the parser to return a nested iterator. Read more
Source§

fn to<U: Copy>(self, data: U) -> To<T, Self, U>
where Self: Sized,

Discard the parsed value and replace it with a fixed value
Source§

fn full(self) -> Full<T, Self>
where Self: Sized,

Require the parser to match the entire input
Source§

fn or<P: Parser<T>>(self, other: P) -> Choice<(Self, P), T>
where Self: Sized,

Allow the parser to fallback to another parser in case of failure Read more
Source§

fn validate<F: Fn(&T) -> bool>(self, validator: F) -> Validate<T, Self, F>
where Self: Sized,

Validate the parsed value with a predicate
Source§

fn validate_or_critical<F: Fn(&T) -> bool>( self, validator: F, message: &'static str, ) -> ValidateOrCriticalMsg<T, Self, F>
where Self: Sized,

Validate the parsed value with a predicate or return a provided critical error message Read more
Source§

fn validate_or_dynamic_critical<F: Fn(&T) -> Result<(), Cow<'static, str>>>( self, validator: F, ) -> ValidateOrDynamicCriticalMsg<T, Self, F>
where Self: Sized,

Validate the parsed value with a predicate or return a critical error message Read more
Source§

fn debug<F: for<'a, 'b> Fn(DebugType<'a, 'b, T>)>( self, debugger: F, ) -> Debugging<T, Self, F>
where Self: Sized,

Debug the input and output values of the parser using the provided debugger
Source§

fn erase_type(self) -> Box<dyn Parser<T> + Send + Sync>
where Self: Sized + Send + Sync + 'static,

“Erase” the parser’s type Read more
Source§

fn static_ref(&'static self) -> StaticRef<T, Self>
where Self: Sized,

Wrap a static reference to this parser inside a new parser Read more
Source§

impl<F: Parser<Output>, G: Parser<Output>, H: Parser<Output>, I: Parser<Output>, J: Parser<Output>, K: Parser<Output>, L: Parser<Output>, M: Parser<Output>, N: Parser<Output>, O: Parser<Output>, P: Parser<Output>, Q: Parser<Output>, R: Parser<Output>, S: Parser<Output>, T: Parser<Output>, U: Parser<Output>, V: Parser<Output>, W: Parser<Output>, X: Parser<Output>, Y: Parser<Output>, Z: Parser<Output>, Output> Parser<Output> for Choice<(F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z), Output>

Source§

fn parse_inner(&self, input: &mut ParserInput<'_>) -> ParserResult<Output>

Inner parsing function, to implement
Source§

fn parse(&self, input: &mut ParserInput<'_>) -> ParserResult<T>

Parse an input with the current parser Read more
Source§

fn parse_str(&self, str: &str) -> ParserResult<T>

Parse a string Read more
Source§

fn parse_str_with_file_id(&self, str: &str, file_id: FileId) -> ParserResult<T>

Parse a string as a file Read more
Source§

fn then<U, P: Parser<U>>(self, other: P) -> Then<T, Self, U, P>
where Self: Sized,

Chain this parser with another, getting both parsers’ results combined
Source§

fn then_ignore<U, P: Parser<U>>(self, other: P) -> ThenIgnore<T, Self, U, P>
where Self: Sized,

Chain this parser with another but discard the latter’s parsed value
Source§

fn ignore_then<U, P: Parser<U>>(self, other: P) -> IgnoreThen<T, Self, U, P>
where Self: Sized,

Chain this parser with another but discard the former’s parsed value
Source§

fn followed_by<U, P: Parser<U>>(self, other: P) -> FollowedBy<T, Self, U, P>
where Self: Sized,

Only match if this parser succeeds and the provided parser succeeds as well Read more
Source§

fn not_followed_by<U, P: Parser<U>>( self, other: P, ) -> NotFollowedBy<T, Self, U, P>
where Self: Sized,

Only match if this parser succeeds and the provided parser doesn’t
Source§

fn repeated(self) -> Repeated<T, Self, NoAllocContainer>
where Self: Sized,

Parse as many times as possible, until the parser eventually fails Read more
Source§

fn repeated_into_vec(self) -> Repeated<T, Self, Vec<T>>
where Self: Sized,

Parse as many times as possible, until the parser eventually fails Read more
Source§

fn repeated_into_container<C: Container<T>>(self) -> Repeated<T, Self, C>
where Self: Sized,

Parse as many times as possible, until the parser eventually fails Read more
Source§

fn or_not(self) -> OrNot<T, Self>
where Self: Sized,

Try to parse Read more
Source§

fn map<U, F: Fn(T) -> U>(self, mapper: F) -> Map<T, Self, U, F>
where Self: Sized,

Map the parsed value using a function Read more
Source§

fn map_str<U, F: Fn(&str) -> U>(self, mapper: F) -> MapStr<T, Self, U, F>
where Self: Sized,

Get the input string matched by the parser and map it using a function
Source§

fn try_map<U, F: Fn(T) -> Option<U>>(self, mapper: F) -> TryMap<T, Self, U, F>
where Self: Sized,

Try to map the parsed value using a function
Source§

fn and_then<U, F: Fn(T) -> Result<U, ParsingError>>( self, mapper: F, ) -> AndThen<T, Self, U, F>
where Self: Sized,

Transform and validate the parsed value using the provided function Read more
Source§

fn and_then_or_critical<U, F: Fn(T) -> Result<U, Cow<'static, str>>>( self, mapper: F, ) -> AndThenOrCritical<T, Self, U, F>
where Self: Sized,

Transform and validate the parsed value using the provided function Failures are critical
Source§

fn spanned(self) -> Spanned<T, Self>
where Self: Sized,

Wrap the parsed value in a Spanned
Source§

fn collect<C>(self) -> Map<T, Self, C, fn(T) -> C>
where Self: Sized, T: IntoIterator, C: FromIterator<T::Item>,

Collect the parsed value using the provided iterator type
Source§

fn collect_string(self) -> StringCollected<T, Self>
where Self: Sized,

Collect the input string matched by the parser
Source§

fn atomic_err(self, message: &'static str) -> AtomicErr<T, Self>
where Self: Sized,

Provide an atomic error if the parser fails Read more
Source§

fn critical(self, message: &'static str) -> Critical<T, Self>
where Self: Sized,

Mark the parser as critical Read more
Source§

fn critical_auto_msg(self) -> Critical<T, Self>
where Self: Sized,

Mark the parser as critical Read more
Source§

fn silent(self) -> Silenced<T, Self>
where Self: Sized,

Make the parser silent Read more
Source§

fn padded_by<P, PP: Parser<P>>(self, padding: PP) -> Padded<T, Self, P, PP>
where Self: Sized,

Require the parser to be preceded by and followed by the provided padding Read more
Source§

fn line_padded(self) -> LinePadded<T, Self>
where Self: Sized,

Allow the parser to be surrounded by whitespaces (not newlines)
Source§

fn surrounded_by<L, LP: Parser<L>, R, RP: Parser<R>>( self, left: LP, right: RP, ) -> SurroundedBy<L, LP, T, Self, R, RP>
where Self: Sized,

Require the parser to be preceded by and followed by the provided parsers Read more
Source§

fn separated_by<S, P: Parser<S>>( self, sep: P, ) -> SeparatedBy<T, Self, S, P, NoAllocContainer>
where Self: Sized,

Repeat the parser with the required provided separator between each repetition Read more
Source§

fn separated_by_into_vec<S, P: Parser<S>>( self, sep: P, ) -> SeparatedBy<T, Self, S, P, Vec<T>>
where Self: Sized,

Repeat the parser with the required provided separator between each repetition Read more
Source§

fn separated_by_into_container<C: Container<T>, S, P: Parser<S>>( self, sep: P, ) -> SeparatedBy<T, Self, S, P, C>
where Self: Sized,

Repeat the parser with the required provided separator between each repetition Read more
Source§

fn flatten<U, S>(self) -> Flattened<U, S, T, Self, NoAllocContainer>
where Self: Sized, T: IntoIterator<Item = S>, S: IntoIterator<Item = U>,

Flatten the parser Read more
Source§

fn flatten_into_vec<U, S>(self) -> Flattened<U, S, T, Self, Vec<U>>
where Self: Sized, T: IntoIterator<Item = S>, S: IntoIterator<Item = U>,

Flatten the parser Requires the parser to return a nested iterator. Read more
Source§

fn flatten_into_container<U, S, C: Container<U>>( self, ) -> Flattened<U, S, T, Self, C>
where Self: Sized, T: IntoIterator<Item = S>, S: IntoIterator<Item = U>,

Flatten the parser Requires the parser to return a nested iterator. Read more
Source§

fn to<U: Copy>(self, data: U) -> To<T, Self, U>
where Self: Sized,

Discard the parsed value and replace it with a fixed value
Source§

fn full(self) -> Full<T, Self>
where Self: Sized,

Require the parser to match the entire input
Source§

fn or<P: Parser<T>>(self, other: P) -> Choice<(Self, P), T>
where Self: Sized,

Allow the parser to fallback to another parser in case of failure Read more
Source§

fn validate<F: Fn(&T) -> bool>(self, validator: F) -> Validate<T, Self, F>
where Self: Sized,

Validate the parsed value with a predicate
Source§

fn validate_or_critical<F: Fn(&T) -> bool>( self, validator: F, message: &'static str, ) -> ValidateOrCriticalMsg<T, Self, F>
where Self: Sized,

Validate the parsed value with a predicate or return a provided critical error message Read more
Source§

fn validate_or_dynamic_critical<F: Fn(&T) -> Result<(), Cow<'static, str>>>( self, validator: F, ) -> ValidateOrDynamicCriticalMsg<T, Self, F>
where Self: Sized,

Validate the parsed value with a predicate or return a critical error message Read more
Source§

fn debug<F: for<'a, 'b> Fn(DebugType<'a, 'b, T>)>( self, debugger: F, ) -> Debugging<T, Self, F>
where Self: Sized,

Debug the input and output values of the parser using the provided debugger
Source§

fn erase_type(self) -> Box<dyn Parser<T> + Send + Sync>
where Self: Sized + Send + Sync + 'static,

“Erase” the parser’s type Read more
Source§

fn static_ref(&'static self) -> StaticRef<T, Self>
where Self: Sized,

Wrap a static reference to this parser inside a new parser Read more
Source§

impl<G: Parser<Output>, H: Parser<Output>, I: Parser<Output>, J: Parser<Output>, K: Parser<Output>, L: Parser<Output>, M: Parser<Output>, N: Parser<Output>, O: Parser<Output>, P: Parser<Output>, Q: Parser<Output>, R: Parser<Output>, S: Parser<Output>, T: Parser<Output>, U: Parser<Output>, V: Parser<Output>, W: Parser<Output>, X: Parser<Output>, Y: Parser<Output>, Z: Parser<Output>, Output> Parser<Output> for Choice<(G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z), Output>

Source§

fn parse_inner(&self, input: &mut ParserInput<'_>) -> ParserResult<Output>

Inner parsing function, to implement
Source§

fn parse(&self, input: &mut ParserInput<'_>) -> ParserResult<T>

Parse an input with the current parser Read more
Source§

fn parse_str(&self, str: &str) -> ParserResult<T>

Parse a string Read more
Source§

fn parse_str_with_file_id(&self, str: &str, file_id: FileId) -> ParserResult<T>

Parse a string as a file Read more
Source§

fn then<U, P: Parser<U>>(self, other: P) -> Then<T, Self, U, P>
where Self: Sized,

Chain this parser with another, getting both parsers’ results combined
Source§

fn then_ignore<U, P: Parser<U>>(self, other: P) -> ThenIgnore<T, Self, U, P>
where Self: Sized,

Chain this parser with another but discard the latter’s parsed value
Source§

fn ignore_then<U, P: Parser<U>>(self, other: P) -> IgnoreThen<T, Self, U, P>
where Self: Sized,

Chain this parser with another but discard the former’s parsed value
Source§

fn followed_by<U, P: Parser<U>>(self, other: P) -> FollowedBy<T, Self, U, P>
where Self: Sized,

Only match if this parser succeeds and the provided parser succeeds as well Read more
Source§

fn not_followed_by<U, P: Parser<U>>( self, other: P, ) -> NotFollowedBy<T, Self, U, P>
where Self: Sized,

Only match if this parser succeeds and the provided parser doesn’t
Source§

fn repeated(self) -> Repeated<T, Self, NoAllocContainer>
where Self: Sized,

Parse as many times as possible, until the parser eventually fails Read more
Source§

fn repeated_into_vec(self) -> Repeated<T, Self, Vec<T>>
where Self: Sized,

Parse as many times as possible, until the parser eventually fails Read more
Source§

fn repeated_into_container<C: Container<T>>(self) -> Repeated<T, Self, C>
where Self: Sized,

Parse as many times as possible, until the parser eventually fails Read more
Source§

fn or_not(self) -> OrNot<T, Self>
where Self: Sized,

Try to parse Read more
Source§

fn map<U, F: Fn(T) -> U>(self, mapper: F) -> Map<T, Self, U, F>
where Self: Sized,

Map the parsed value using a function Read more
Source§

fn map_str<U, F: Fn(&str) -> U>(self, mapper: F) -> MapStr<T, Self, U, F>
where Self: Sized,

Get the input string matched by the parser and map it using a function
Source§

fn try_map<U, F: Fn(T) -> Option<U>>(self, mapper: F) -> TryMap<T, Self, U, F>
where Self: Sized,

Try to map the parsed value using a function
Source§

fn and_then<U, F: Fn(T) -> Result<U, ParsingError>>( self, mapper: F, ) -> AndThen<T, Self, U, F>
where Self: Sized,

Transform and validate the parsed value using the provided function Read more
Source§

fn and_then_or_critical<U, F: Fn(T) -> Result<U, Cow<'static, str>>>( self, mapper: F, ) -> AndThenOrCritical<T, Self, U, F>
where Self: Sized,

Transform and validate the parsed value using the provided function Failures are critical
Source§

fn spanned(self) -> Spanned<T, Self>
where Self: Sized,

Wrap the parsed value in a Spanned
Source§

fn collect<C>(self) -> Map<T, Self, C, fn(T) -> C>
where Self: Sized, T: IntoIterator, C: FromIterator<T::Item>,

Collect the parsed value using the provided iterator type
Source§

fn collect_string(self) -> StringCollected<T, Self>
where Self: Sized,

Collect the input string matched by the parser
Source§

fn atomic_err(self, message: &'static str) -> AtomicErr<T, Self>
where Self: Sized,

Provide an atomic error if the parser fails Read more
Source§

fn critical(self, message: &'static str) -> Critical<T, Self>
where Self: Sized,

Mark the parser as critical Read more
Source§

fn critical_auto_msg(self) -> Critical<T, Self>
where Self: Sized,

Mark the parser as critical Read more
Source§

fn silent(self) -> Silenced<T, Self>
where Self: Sized,

Make the parser silent Read more
Source§

fn padded_by<P, PP: Parser<P>>(self, padding: PP) -> Padded<T, Self, P, PP>
where Self: Sized,

Require the parser to be preceded by and followed by the provided padding Read more
Source§

fn line_padded(self) -> LinePadded<T, Self>
where Self: Sized,

Allow the parser to be surrounded by whitespaces (not newlines)
Source§

fn surrounded_by<L, LP: Parser<L>, R, RP: Parser<R>>( self, left: LP, right: RP, ) -> SurroundedBy<L, LP, T, Self, R, RP>
where Self: Sized,

Require the parser to be preceded by and followed by the provided parsers Read more
Source§

fn separated_by<S, P: Parser<S>>( self, sep: P, ) -> SeparatedBy<T, Self, S, P, NoAllocContainer>
where Self: Sized,

Repeat the parser with the required provided separator between each repetition Read more
Source§

fn separated_by_into_vec<S, P: Parser<S>>( self, sep: P, ) -> SeparatedBy<T, Self, S, P, Vec<T>>
where Self: Sized,

Repeat the parser with the required provided separator between each repetition Read more
Source§

fn separated_by_into_container<C: Container<T>, S, P: Parser<S>>( self, sep: P, ) -> SeparatedBy<T, Self, S, P, C>
where Self: Sized,

Repeat the parser with the required provided separator between each repetition Read more
Source§

fn flatten<U, S>(self) -> Flattened<U, S, T, Self, NoAllocContainer>
where Self: Sized, T: IntoIterator<Item = S>, S: IntoIterator<Item = U>,

Flatten the parser Read more
Source§

fn flatten_into_vec<U, S>(self) -> Flattened<U, S, T, Self, Vec<U>>
where Self: Sized, T: IntoIterator<Item = S>, S: IntoIterator<Item = U>,

Flatten the parser Requires the parser to return a nested iterator. Read more
Source§

fn flatten_into_container<U, S, C: Container<U>>( self, ) -> Flattened<U, S, T, Self, C>
where Self: Sized, T: IntoIterator<Item = S>, S: IntoIterator<Item = U>,

Flatten the parser Requires the parser to return a nested iterator. Read more
Source§

fn to<U: Copy>(self, data: U) -> To<T, Self, U>
where Self: Sized,

Discard the parsed value and replace it with a fixed value
Source§

fn full(self) -> Full<T, Self>
where Self: Sized,

Require the parser to match the entire input
Source§

fn or<P: Parser<T>>(self, other: P) -> Choice<(Self, P), T>
where Self: Sized,

Allow the parser to fallback to another parser in case of failure Read more
Source§

fn validate<F: Fn(&T) -> bool>(self, validator: F) -> Validate<T, Self, F>
where Self: Sized,

Validate the parsed value with a predicate
Source§

fn validate_or_critical<F: Fn(&T) -> bool>( self, validator: F, message: &'static str, ) -> ValidateOrCriticalMsg<T, Self, F>
where Self: Sized,

Validate the parsed value with a predicate or return a provided critical error message Read more
Source§

fn validate_or_dynamic_critical<F: Fn(&T) -> Result<(), Cow<'static, str>>>( self, validator: F, ) -> ValidateOrDynamicCriticalMsg<T, Self, F>
where Self: Sized,

Validate the parsed value with a predicate or return a critical error message Read more
Source§

fn debug<F: for<'a, 'b> Fn(DebugType<'a, 'b, T>)>( self, debugger: F, ) -> Debugging<T, Self, F>
where Self: Sized,

Debug the input and output values of the parser using the provided debugger
Source§

fn erase_type(self) -> Box<dyn Parser<T> + Send + Sync>
where Self: Sized + Send + Sync + 'static,

“Erase” the parser’s type Read more
Source§

fn static_ref(&'static self) -> StaticRef<T, Self>
where Self: Sized,

Wrap a static reference to this parser inside a new parser Read more
Source§

impl<H: Parser<Output>, I: Parser<Output>, J: Parser<Output>, K: Parser<Output>, L: Parser<Output>, M: Parser<Output>, N: Parser<Output>, O: Parser<Output>, P: Parser<Output>, Q: Parser<Output>, R: Parser<Output>, S: Parser<Output>, T: Parser<Output>, U: Parser<Output>, V: Parser<Output>, W: Parser<Output>, X: Parser<Output>, Y: Parser<Output>, Z: Parser<Output>, Output> Parser<Output> for Choice<(H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z), Output>

Source§

fn parse_inner(&self, input: &mut ParserInput<'_>) -> ParserResult<Output>

Inner parsing function, to implement
Source§

fn parse(&self, input: &mut ParserInput<'_>) -> ParserResult<T>

Parse an input with the current parser Read more
Source§

fn parse_str(&self, str: &str) -> ParserResult<T>

Parse a string Read more
Source§

fn parse_str_with_file_id(&self, str: &str, file_id: FileId) -> ParserResult<T>

Parse a string as a file Read more
Source§

fn then<U, P: Parser<U>>(self, other: P) -> Then<T, Self, U, P>
where Self: Sized,

Chain this parser with another, getting both parsers’ results combined
Source§

fn then_ignore<U, P: Parser<U>>(self, other: P) -> ThenIgnore<T, Self, U, P>
where Self: Sized,

Chain this parser with another but discard the latter’s parsed value
Source§

fn ignore_then<U, P: Parser<U>>(self, other: P) -> IgnoreThen<T, Self, U, P>
where Self: Sized,

Chain this parser with another but discard the former’s parsed value
Source§

fn followed_by<U, P: Parser<U>>(self, other: P) -> FollowedBy<T, Self, U, P>
where Self: Sized,

Only match if this parser succeeds and the provided parser succeeds as well Read more
Source§

fn not_followed_by<U, P: Parser<U>>( self, other: P, ) -> NotFollowedBy<T, Self, U, P>
where Self: Sized,

Only match if this parser succeeds and the provided parser doesn’t
Source§

fn repeated(self) -> Repeated<T, Self, NoAllocContainer>
where Self: Sized,

Parse as many times as possible, until the parser eventually fails Read more
Source§

fn repeated_into_vec(self) -> Repeated<T, Self, Vec<T>>
where Self: Sized,

Parse as many times as possible, until the parser eventually fails Read more
Source§

fn repeated_into_container<C: Container<T>>(self) -> Repeated<T, Self, C>
where Self: Sized,

Parse as many times as possible, until the parser eventually fails Read more
Source§

fn or_not(self) -> OrNot<T, Self>
where Self: Sized,

Try to parse Read more
Source§

fn map<U, F: Fn(T) -> U>(self, mapper: F) -> Map<T, Self, U, F>
where Self: Sized,

Map the parsed value using a function Read more
Source§

fn map_str<U, F: Fn(&str) -> U>(self, mapper: F) -> MapStr<T, Self, U, F>
where Self: Sized,

Get the input string matched by the parser and map it using a function
Source§

fn try_map<U, F: Fn(T) -> Option<U>>(self, mapper: F) -> TryMap<T, Self, U, F>
where Self: Sized,

Try to map the parsed value using a function
Source§

fn and_then<U, F: Fn(T) -> Result<U, ParsingError>>( self, mapper: F, ) -> AndThen<T, Self, U, F>
where Self: Sized,

Transform and validate the parsed value using the provided function Read more
Source§

fn and_then_or_critical<U, F: Fn(T) -> Result<U, Cow<'static, str>>>( self, mapper: F, ) -> AndThenOrCritical<T, Self, U, F>
where Self: Sized,

Transform and validate the parsed value using the provided function Failures are critical
Source§

fn spanned(self) -> Spanned<T, Self>
where Self: Sized,

Wrap the parsed value in a Spanned
Source§

fn collect<C>(self) -> Map<T, Self, C, fn(T) -> C>
where Self: Sized, T: IntoIterator, C: FromIterator<T::Item>,

Collect the parsed value using the provided iterator type
Source§

fn collect_string(self) -> StringCollected<T, Self>
where Self: Sized,

Collect the input string matched by the parser
Source§

fn atomic_err(self, message: &'static str) -> AtomicErr<T, Self>
where Self: Sized,

Provide an atomic error if the parser fails Read more
Source§

fn critical(self, message: &'static str) -> Critical<T, Self>
where Self: Sized,

Mark the parser as critical Read more
Source§

fn critical_auto_msg(self) -> Critical<T, Self>
where Self: Sized,

Mark the parser as critical Read more
Source§

fn silent(self) -> Silenced<T, Self>
where Self: Sized,

Make the parser silent Read more
Source§

fn padded_by<P, PP: Parser<P>>(self, padding: PP) -> Padded<T, Self, P, PP>
where Self: Sized,

Require the parser to be preceded by and followed by the provided padding Read more
Source§

fn line_padded(self) -> LinePadded<T, Self>
where Self: Sized,

Allow the parser to be surrounded by whitespaces (not newlines)
Source§

fn surrounded_by<L, LP: Parser<L>, R, RP: Parser<R>>( self, left: LP, right: RP, ) -> SurroundedBy<L, LP, T, Self, R, RP>
where Self: Sized,

Require the parser to be preceded by and followed by the provided parsers Read more
Source§

fn separated_by<S, P: Parser<S>>( self, sep: P, ) -> SeparatedBy<T, Self, S, P, NoAllocContainer>
where Self: Sized,

Repeat the parser with the required provided separator between each repetition Read more
Source§

fn separated_by_into_vec<S, P: Parser<S>>( self, sep: P, ) -> SeparatedBy<T, Self, S, P, Vec<T>>
where Self: Sized,

Repeat the parser with the required provided separator between each repetition Read more
Source§

fn separated_by_into_container<C: Container<T>, S, P: Parser<S>>( self, sep: P, ) -> SeparatedBy<T, Self, S, P, C>
where Self: Sized,

Repeat the parser with the required provided separator between each repetition Read more
Source§

fn flatten<U, S>(self) -> Flattened<U, S, T, Self, NoAllocContainer>
where Self: Sized, T: IntoIterator<Item = S>, S: IntoIterator<Item = U>,

Flatten the parser Read more
Source§

fn flatten_into_vec<U, S>(self) -> Flattened<U, S, T, Self, Vec<U>>
where Self: Sized, T: IntoIterator<Item = S>, S: IntoIterator<Item = U>,

Flatten the parser Requires the parser to return a nested iterator. Read more
Source§

fn flatten_into_container<U, S, C: Container<U>>( self, ) -> Flattened<U, S, T, Self, C>
where Self: Sized, T: IntoIterator<Item = S>, S: IntoIterator<Item = U>,

Flatten the parser Requires the parser to return a nested iterator. Read more
Source§

fn to<U: Copy>(self, data: U) -> To<T, Self, U>
where Self: Sized,

Discard the parsed value and replace it with a fixed value
Source§

fn full(self) -> Full<T, Self>
where Self: Sized,

Require the parser to match the entire input
Source§

fn or<P: Parser<T>>(self, other: P) -> Choice<(Self, P), T>
where Self: Sized,

Allow the parser to fallback to another parser in case of failure Read more
Source§

fn validate<F: Fn(&T) -> bool>(self, validator: F) -> Validate<T, Self, F>
where Self: Sized,

Validate the parsed value with a predicate
Source§

fn validate_or_critical<F: Fn(&T) -> bool>( self, validator: F, message: &'static str, ) -> ValidateOrCriticalMsg<T, Self, F>
where Self: Sized,

Validate the parsed value with a predicate or return a provided critical error message Read more
Source§

fn validate_or_dynamic_critical<F: Fn(&T) -> Result<(), Cow<'static, str>>>( self, validator: F, ) -> ValidateOrDynamicCriticalMsg<T, Self, F>
where Self: Sized,

Validate the parsed value with a predicate or return a critical error message Read more
Source§

fn debug<F: for<'a, 'b> Fn(DebugType<'a, 'b, T>)>( self, debugger: F, ) -> Debugging<T, Self, F>
where Self: Sized,

Debug the input and output values of the parser using the provided debugger
Source§

fn erase_type(self) -> Box<dyn Parser<T> + Send + Sync>
where Self: Sized + Send + Sync + 'static,

“Erase” the parser’s type Read more
Source§

fn static_ref(&'static self) -> StaticRef<T, Self>
where Self: Sized,

Wrap a static reference to this parser inside a new parser Read more
Source§

impl<I: Parser<Output>, J: Parser<Output>, K: Parser<Output>, L: Parser<Output>, M: Parser<Output>, N: Parser<Output>, O: Parser<Output>, P: Parser<Output>, Q: Parser<Output>, R: Parser<Output>, S: Parser<Output>, T: Parser<Output>, U: Parser<Output>, V: Parser<Output>, W: Parser<Output>, X: Parser<Output>, Y: Parser<Output>, Z: Parser<Output>, Output> Parser<Output> for Choice<(I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z), Output>

Source§

fn parse_inner(&self, input: &mut ParserInput<'_>) -> ParserResult<Output>

Inner parsing function, to implement
Source§

fn parse(&self, input: &mut ParserInput<'_>) -> ParserResult<T>

Parse an input with the current parser Read more
Source§

fn parse_str(&self, str: &str) -> ParserResult<T>

Parse a string Read more
Source§

fn parse_str_with_file_id(&self, str: &str, file_id: FileId) -> ParserResult<T>

Parse a string as a file Read more
Source§

fn then<U, P: Parser<U>>(self, other: P) -> Then<T, Self, U, P>
where Self: Sized,

Chain this parser with another, getting both parsers’ results combined
Source§

fn then_ignore<U, P: Parser<U>>(self, other: P) -> ThenIgnore<T, Self, U, P>
where Self: Sized,

Chain this parser with another but discard the latter’s parsed value
Source§

fn ignore_then<U, P: Parser<U>>(self, other: P) -> IgnoreThen<T, Self, U, P>
where Self: Sized,

Chain this parser with another but discard the former’s parsed value
Source§

fn followed_by<U, P: Parser<U>>(self, other: P) -> FollowedBy<T, Self, U, P>
where Self: Sized,

Only match if this parser succeeds and the provided parser succeeds as well Read more
Source§

fn not_followed_by<U, P: Parser<U>>( self, other: P, ) -> NotFollowedBy<T, Self, U, P>
where Self: Sized,

Only match if this parser succeeds and the provided parser doesn’t
Source§

fn repeated(self) -> Repeated<T, Self, NoAllocContainer>
where Self: Sized,

Parse as many times as possible, until the parser eventually fails Read more
Source§

fn repeated_into_vec(self) -> Repeated<T, Self, Vec<T>>
where Self: Sized,

Parse as many times as possible, until the parser eventually fails Read more
Source§

fn repeated_into_container<C: Container<T>>(self) -> Repeated<T, Self, C>
where Self: Sized,

Parse as many times as possible, until the parser eventually fails Read more
Source§

fn or_not(self) -> OrNot<T, Self>
where Self: Sized,

Try to parse Read more
Source§

fn map<U, F: Fn(T) -> U>(self, mapper: F) -> Map<T, Self, U, F>
where Self: Sized,

Map the parsed value using a function Read more
Source§

fn map_str<U, F: Fn(&str) -> U>(self, mapper: F) -> MapStr<T, Self, U, F>
where Self: Sized,

Get the input string matched by the parser and map it using a function
Source§

fn try_map<U, F: Fn(T) -> Option<U>>(self, mapper: F) -> TryMap<T, Self, U, F>
where Self: Sized,

Try to map the parsed value using a function
Source§

fn and_then<U, F: Fn(T) -> Result<U, ParsingError>>( self, mapper: F, ) -> AndThen<T, Self, U, F>
where Self: Sized,

Transform and validate the parsed value using the provided function Read more
Source§

fn and_then_or_critical<U, F: Fn(T) -> Result<U, Cow<'static, str>>>( self, mapper: F, ) -> AndThenOrCritical<T, Self, U, F>
where Self: Sized,

Transform and validate the parsed value using the provided function Failures are critical
Source§

fn spanned(self) -> Spanned<T, Self>
where Self: Sized,

Wrap the parsed value in a Spanned
Source§

fn collect<C>(self) -> Map<T, Self, C, fn(T) -> C>
where Self: Sized, T: IntoIterator, C: FromIterator<T::Item>,

Collect the parsed value using the provided iterator type
Source§

fn collect_string(self) -> StringCollected<T, Self>
where Self: Sized,

Collect the input string matched by the parser
Source§

fn atomic_err(self, message: &'static str) -> AtomicErr<T, Self>
where Self: Sized,

Provide an atomic error if the parser fails Read more
Source§

fn critical(self, message: &'static str) -> Critical<T, Self>
where Self: Sized,

Mark the parser as critical Read more
Source§

fn critical_auto_msg(self) -> Critical<T, Self>
where Self: Sized,

Mark the parser as critical Read more
Source§

fn silent(self) -> Silenced<T, Self>
where Self: Sized,

Make the parser silent Read more
Source§

fn padded_by<P, PP: Parser<P>>(self, padding: PP) -> Padded<T, Self, P, PP>
where Self: Sized,

Require the parser to be preceded by and followed by the provided padding Read more
Source§

fn line_padded(self) -> LinePadded<T, Self>
where Self: Sized,

Allow the parser to be surrounded by whitespaces (not newlines)
Source§

fn surrounded_by<L, LP: Parser<L>, R, RP: Parser<R>>( self, left: LP, right: RP, ) -> SurroundedBy<L, LP, T, Self, R, RP>
where Self: Sized,

Require the parser to be preceded by and followed by the provided parsers Read more
Source§

fn separated_by<S, P: Parser<S>>( self, sep: P, ) -> SeparatedBy<T, Self, S, P, NoAllocContainer>
where Self: Sized,

Repeat the parser with the required provided separator between each repetition Read more
Source§

fn separated_by_into_vec<S, P: Parser<S>>( self, sep: P, ) -> SeparatedBy<T, Self, S, P, Vec<T>>
where Self: Sized,

Repeat the parser with the required provided separator between each repetition Read more
Source§

fn separated_by_into_container<C: Container<T>, S, P: Parser<S>>( self, sep: P, ) -> SeparatedBy<T, Self, S, P, C>
where Self: Sized,

Repeat the parser with the required provided separator between each repetition Read more
Source§

fn flatten<U, S>(self) -> Flattened<U, S, T, Self, NoAllocContainer>
where Self: Sized, T: IntoIterator<Item = S>, S: IntoIterator<Item = U>,

Flatten the parser Read more
Source§

fn flatten_into_vec<U, S>(self) -> Flattened<U, S, T, Self, Vec<U>>
where Self: Sized, T: IntoIterator<Item = S>, S: IntoIterator<Item = U>,

Flatten the parser Requires the parser to return a nested iterator. Read more
Source§

fn flatten_into_container<U, S, C: Container<U>>( self, ) -> Flattened<U, S, T, Self, C>
where Self: Sized, T: IntoIterator<Item = S>, S: IntoIterator<Item = U>,

Flatten the parser Requires the parser to return a nested iterator. Read more
Source§

fn to<U: Copy>(self, data: U) -> To<T, Self, U>
where Self: Sized,

Discard the parsed value and replace it with a fixed value
Source§

fn full(self) -> Full<T, Self>
where Self: Sized,

Require the parser to match the entire input
Source§

fn or<P: Parser<T>>(self, other: P) -> Choice<(Self, P), T>
where Self: Sized,

Allow the parser to fallback to another parser in case of failure Read more
Source§

fn validate<F: Fn(&T) -> bool>(self, validator: F) -> Validate<T, Self, F>
where Self: Sized,

Validate the parsed value with a predicate
Source§

fn validate_or_critical<F: Fn(&T) -> bool>( self, validator: F, message: &'static str, ) -> ValidateOrCriticalMsg<T, Self, F>
where Self: Sized,

Validate the parsed value with a predicate or return a provided critical error message Read more
Source§

fn validate_or_dynamic_critical<F: Fn(&T) -> Result<(), Cow<'static, str>>>( self, validator: F, ) -> ValidateOrDynamicCriticalMsg<T, Self, F>
where Self: Sized,

Validate the parsed value with a predicate or return a critical error message Read more
Source§

fn debug<F: for<'a, 'b> Fn(DebugType<'a, 'b, T>)>( self, debugger: F, ) -> Debugging<T, Self, F>
where Self: Sized,

Debug the input and output values of the parser using the provided debugger
Source§

fn erase_type(self) -> Box<dyn Parser<T> + Send + Sync>
where Self: Sized + Send + Sync + 'static,

“Erase” the parser’s type Read more
Source§

fn static_ref(&'static self) -> StaticRef<T, Self>
where Self: Sized,

Wrap a static reference to this parser inside a new parser Read more
Source§

impl<J: Parser<Output>, K: Parser<Output>, L: Parser<Output>, M: Parser<Output>, N: Parser<Output>, O: Parser<Output>, P: Parser<Output>, Q: Parser<Output>, R: Parser<Output>, S: Parser<Output>, T: Parser<Output>, U: Parser<Output>, V: Parser<Output>, W: Parser<Output>, X: Parser<Output>, Y: Parser<Output>, Z: Parser<Output>, Output> Parser<Output> for Choice<(J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z), Output>

Source§

fn parse_inner(&self, input: &mut ParserInput<'_>) -> ParserResult<Output>

Inner parsing function, to implement
Source§

fn parse(&self, input: &mut ParserInput<'_>) -> ParserResult<T>

Parse an input with the current parser Read more
Source§

fn parse_str(&self, str: &str) -> ParserResult<T>

Parse a string Read more
Source§

fn parse_str_with_file_id(&self, str: &str, file_id: FileId) -> ParserResult<T>

Parse a string as a file Read more
Source§

fn then<U, P: Parser<U>>(self, other: P) -> Then<T, Self, U, P>
where Self: Sized,

Chain this parser with another, getting both parsers’ results combined
Source§

fn then_ignore<U, P: Parser<U>>(self, other: P) -> ThenIgnore<T, Self, U, P>
where Self: Sized,

Chain this parser with another but discard the latter’s parsed value
Source§

fn ignore_then<U, P: Parser<U>>(self, other: P) -> IgnoreThen<T, Self, U, P>
where Self: Sized,

Chain this parser with another but discard the former’s parsed value
Source§

fn followed_by<U, P: Parser<U>>(self, other: P) -> FollowedBy<T, Self, U, P>
where Self: Sized,

Only match if this parser succeeds and the provided parser succeeds as well Read more
Source§

fn not_followed_by<U, P: Parser<U>>( self, other: P, ) -> NotFollowedBy<T, Self, U, P>
where Self: Sized,

Only match if this parser succeeds and the provided parser doesn’t
Source§

fn repeated(self) -> Repeated<T, Self, NoAllocContainer>
where Self: Sized,

Parse as many times as possible, until the parser eventually fails Read more
Source§

fn repeated_into_vec(self) -> Repeated<T, Self, Vec<T>>
where Self: Sized,

Parse as many times as possible, until the parser eventually fails Read more
Source§

fn repeated_into_container<C: Container<T>>(self) -> Repeated<T, Self, C>
where Self: Sized,

Parse as many times as possible, until the parser eventually fails Read more
Source§

fn or_not(self) -> OrNot<T, Self>
where Self: Sized,

Try to parse Read more
Source§

fn map<U, F: Fn(T) -> U>(self, mapper: F) -> Map<T, Self, U, F>
where Self: Sized,

Map the parsed value using a function Read more
Source§

fn map_str<U, F: Fn(&str) -> U>(self, mapper: F) -> MapStr<T, Self, U, F>
where Self: Sized,

Get the input string matched by the parser and map it using a function
Source§

fn try_map<U, F: Fn(T) -> Option<U>>(self, mapper: F) -> TryMap<T, Self, U, F>
where Self: Sized,

Try to map the parsed value using a function
Source§

fn and_then<U, F: Fn(T) -> Result<U, ParsingError>>( self, mapper: F, ) -> AndThen<T, Self, U, F>
where Self: Sized,

Transform and validate the parsed value using the provided function Read more
Source§

fn and_then_or_critical<U, F: Fn(T) -> Result<U, Cow<'static, str>>>( self, mapper: F, ) -> AndThenOrCritical<T, Self, U, F>
where Self: Sized,

Transform and validate the parsed value using the provided function Failures are critical
Source§

fn spanned(self) -> Spanned<T, Self>
where Self: Sized,

Wrap the parsed value in a Spanned
Source§

fn collect<C>(self) -> Map<T, Self, C, fn(T) -> C>
where Self: Sized, T: IntoIterator, C: FromIterator<T::Item>,

Collect the parsed value using the provided iterator type
Source§

fn collect_string(self) -> StringCollected<T, Self>
where Self: Sized,

Collect the input string matched by the parser
Source§

fn atomic_err(self, message: &'static str) -> AtomicErr<T, Self>
where Self: Sized,

Provide an atomic error if the parser fails Read more
Source§

fn critical(self, message: &'static str) -> Critical<T, Self>
where Self: Sized,

Mark the parser as critical Read more
Source§

fn critical_auto_msg(self) -> Critical<T, Self>
where Self: Sized,

Mark the parser as critical Read more
Source§

fn silent(self) -> Silenced<T, Self>
where Self: Sized,

Make the parser silent Read more
Source§

fn padded_by<P, PP: Parser<P>>(self, padding: PP) -> Padded<T, Self, P, PP>
where Self: Sized,

Require the parser to be preceded by and followed by the provided padding Read more
Source§

fn line_padded(self) -> LinePadded<T, Self>
where Self: Sized,

Allow the parser to be surrounded by whitespaces (not newlines)
Source§

fn surrounded_by<L, LP: Parser<L>, R, RP: Parser<R>>( self, left: LP, right: RP, ) -> SurroundedBy<L, LP, T, Self, R, RP>
where Self: Sized,

Require the parser to be preceded by and followed by the provided parsers Read more
Source§

fn separated_by<S, P: Parser<S>>( self, sep: P, ) -> SeparatedBy<T, Self, S, P, NoAllocContainer>
where Self: Sized,

Repeat the parser with the required provided separator between each repetition Read more
Source§

fn separated_by_into_vec<S, P: Parser<S>>( self, sep: P, ) -> SeparatedBy<T, Self, S, P, Vec<T>>
where Self: Sized,

Repeat the parser with the required provided separator between each repetition Read more
Source§

fn separated_by_into_container<C: Container<T>, S, P: Parser<S>>( self, sep: P, ) -> SeparatedBy<T, Self, S, P, C>
where Self: Sized,

Repeat the parser with the required provided separator between each repetition Read more
Source§

fn flatten<U, S>(self) -> Flattened<U, S, T, Self, NoAllocContainer>
where Self: Sized, T: IntoIterator<Item = S>, S: IntoIterator<Item = U>,

Flatten the parser Read more
Source§

fn flatten_into_vec<U, S>(self) -> Flattened<U, S, T, Self, Vec<U>>
where Self: Sized, T: IntoIterator<Item = S>, S: IntoIterator<Item = U>,

Flatten the parser Requires the parser to return a nested iterator. Read more
Source§

fn flatten_into_container<U, S, C: Container<U>>( self, ) -> Flattened<U, S, T, Self, C>
where Self: Sized, T: IntoIterator<Item = S>, S: IntoIterator<Item = U>,

Flatten the parser Requires the parser to return a nested iterator. Read more
Source§

fn to<U: Copy>(self, data: U) -> To<T, Self, U>
where Self: Sized,

Discard the parsed value and replace it with a fixed value
Source§

fn full(self) -> Full<T, Self>
where Self: Sized,

Require the parser to match the entire input
Source§

fn or<P: Parser<T>>(self, other: P) -> Choice<(Self, P), T>
where Self: Sized,

Allow the parser to fallback to another parser in case of failure Read more
Source§

fn validate<F: Fn(&T) -> bool>(self, validator: F) -> Validate<T, Self, F>
where Self: Sized,

Validate the parsed value with a predicate
Source§

fn validate_or_critical<F: Fn(&T) -> bool>( self, validator: F, message: &'static str, ) -> ValidateOrCriticalMsg<T, Self, F>
where Self: Sized,

Validate the parsed value with a predicate or return a provided critical error message Read more
Source§

fn validate_or_dynamic_critical<F: Fn(&T) -> Result<(), Cow<'static, str>>>( self, validator: F, ) -> ValidateOrDynamicCriticalMsg<T, Self, F>
where Self: Sized,

Validate the parsed value with a predicate or return a critical error message Read more
Source§

fn debug<F: for<'a, 'b> Fn(DebugType<'a, 'b, T>)>( self, debugger: F, ) -> Debugging<T, Self, F>
where Self: Sized,

Debug the input and output values of the parser using the provided debugger
Source§

fn erase_type(self) -> Box<dyn Parser<T> + Send + Sync>
where Self: Sized + Send + Sync + 'static,

“Erase” the parser’s type Read more
Source§

fn static_ref(&'static self) -> StaticRef<T, Self>
where Self: Sized,

Wrap a static reference to this parser inside a new parser Read more
Source§

impl<K: Parser<Output>, L: Parser<Output>, M: Parser<Output>, N: Parser<Output>, O: Parser<Output>, P: Parser<Output>, Q: Parser<Output>, R: Parser<Output>, S: Parser<Output>, T: Parser<Output>, U: Parser<Output>, V: Parser<Output>, W: Parser<Output>, X: Parser<Output>, Y: Parser<Output>, Z: Parser<Output>, Output> Parser<Output> for Choice<(K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z), Output>

Source§

fn parse_inner(&self, input: &mut ParserInput<'_>) -> ParserResult<Output>

Inner parsing function, to implement
Source§

fn parse(&self, input: &mut ParserInput<'_>) -> ParserResult<T>

Parse an input with the current parser Read more
Source§

fn parse_str(&self, str: &str) -> ParserResult<T>

Parse a string Read more
Source§

fn parse_str_with_file_id(&self, str: &str, file_id: FileId) -> ParserResult<T>

Parse a string as a file Read more
Source§

fn then<U, P: Parser<U>>(self, other: P) -> Then<T, Self, U, P>
where Self: Sized,

Chain this parser with another, getting both parsers’ results combined
Source§

fn then_ignore<U, P: Parser<U>>(self, other: P) -> ThenIgnore<T, Self, U, P>
where Self: Sized,

Chain this parser with another but discard the latter’s parsed value
Source§

fn ignore_then<U, P: Parser<U>>(self, other: P) -> IgnoreThen<T, Self, U, P>
where Self: Sized,

Chain this parser with another but discard the former’s parsed value
Source§

fn followed_by<U, P: Parser<U>>(self, other: P) -> FollowedBy<T, Self, U, P>
where Self: Sized,

Only match if this parser succeeds and the provided parser succeeds as well Read more
Source§

fn not_followed_by<U, P: Parser<U>>( self, other: P, ) -> NotFollowedBy<T, Self, U, P>
where Self: Sized,

Only match if this parser succeeds and the provided parser doesn’t
Source§

fn repeated(self) -> Repeated<T, Self, NoAllocContainer>
where Self: Sized,

Parse as many times as possible, until the parser eventually fails Read more
Source§

fn repeated_into_vec(self) -> Repeated<T, Self, Vec<T>>
where Self: Sized,

Parse as many times as possible, until the parser eventually fails Read more
Source§

fn repeated_into_container<C: Container<T>>(self) -> Repeated<T, Self, C>
where Self: Sized,

Parse as many times as possible, until the parser eventually fails Read more
Source§

fn or_not(self) -> OrNot<T, Self>
where Self: Sized,

Try to parse Read more
Source§

fn map<U, F: Fn(T) -> U>(self, mapper: F) -> Map<T, Self, U, F>
where Self: Sized,

Map the parsed value using a function Read more
Source§

fn map_str<U, F: Fn(&str) -> U>(self, mapper: F) -> MapStr<T, Self, U, F>
where Self: Sized,

Get the input string matched by the parser and map it using a function
Source§

fn try_map<U, F: Fn(T) -> Option<U>>(self, mapper: F) -> TryMap<T, Self, U, F>
where Self: Sized,

Try to map the parsed value using a function
Source§

fn and_then<U, F: Fn(T) -> Result<U, ParsingError>>( self, mapper: F, ) -> AndThen<T, Self, U, F>
where Self: Sized,

Transform and validate the parsed value using the provided function Read more
Source§

fn and_then_or_critical<U, F: Fn(T) -> Result<U, Cow<'static, str>>>( self, mapper: F, ) -> AndThenOrCritical<T, Self, U, F>
where Self: Sized,

Transform and validate the parsed value using the provided function Failures are critical
Source§

fn spanned(self) -> Spanned<T, Self>
where Self: Sized,

Wrap the parsed value in a Spanned
Source§

fn collect<C>(self) -> Map<T, Self, C, fn(T) -> C>
where Self: Sized, T: IntoIterator, C: FromIterator<T::Item>,

Collect the parsed value using the provided iterator type
Source§

fn collect_string(self) -> StringCollected<T, Self>
where Self: Sized,

Collect the input string matched by the parser
Source§

fn atomic_err(self, message: &'static str) -> AtomicErr<T, Self>
where Self: Sized,

Provide an atomic error if the parser fails Read more
Source§

fn critical(self, message: &'static str) -> Critical<T, Self>
where Self: Sized,

Mark the parser as critical Read more
Source§

fn critical_auto_msg(self) -> Critical<T, Self>
where Self: Sized,

Mark the parser as critical Read more
Source§

fn silent(self) -> Silenced<T, Self>
where Self: Sized,

Make the parser silent Read more
Source§

fn padded_by<P, PP: Parser<P>>(self, padding: PP) -> Padded<T, Self, P, PP>
where Self: Sized,

Require the parser to be preceded by and followed by the provided padding Read more
Source§

fn line_padded(self) -> LinePadded<T, Self>
where Self: Sized,

Allow the parser to be surrounded by whitespaces (not newlines)
Source§

fn surrounded_by<L, LP: Parser<L>, R, RP: Parser<R>>( self, left: LP, right: RP, ) -> SurroundedBy<L, LP, T, Self, R, RP>
where Self: Sized,

Require the parser to be preceded by and followed by the provided parsers Read more
Source§

fn separated_by<S, P: Parser<S>>( self, sep: P, ) -> SeparatedBy<T, Self, S, P, NoAllocContainer>
where Self: Sized,

Repeat the parser with the required provided separator between each repetition Read more
Source§

fn separated_by_into_vec<S, P: Parser<S>>( self, sep: P, ) -> SeparatedBy<T, Self, S, P, Vec<T>>
where Self: Sized,

Repeat the parser with the required provided separator between each repetition Read more
Source§

fn separated_by_into_container<C: Container<T>, S, P: Parser<S>>( self, sep: P, ) -> SeparatedBy<T, Self, S, P, C>
where Self: Sized,

Repeat the parser with the required provided separator between each repetition Read more
Source§

fn flatten<U, S>(self) -> Flattened<U, S, T, Self, NoAllocContainer>
where Self: Sized, T: IntoIterator<Item = S>, S: IntoIterator<Item = U>,

Flatten the parser Read more
Source§

fn flatten_into_vec<U, S>(self) -> Flattened<U, S, T, Self, Vec<U>>
where Self: Sized, T: IntoIterator<Item = S>, S: IntoIterator<Item = U>,

Flatten the parser Requires the parser to return a nested iterator. Read more
Source§

fn flatten_into_container<U, S, C: Container<U>>( self, ) -> Flattened<U, S, T, Self, C>
where Self: Sized, T: IntoIterator<Item = S>, S: IntoIterator<Item = U>,

Flatten the parser Requires the parser to return a nested iterator. Read more
Source§

fn to<U: Copy>(self, data: U) -> To<T, Self, U>
where Self: Sized,

Discard the parsed value and replace it with a fixed value
Source§

fn full(self) -> Full<T, Self>
where Self: Sized,

Require the parser to match the entire input
Source§

fn or<P: Parser<T>>(self, other: P) -> Choice<(Self, P), T>
where Self: Sized,

Allow the parser to fallback to another parser in case of failure Read more
Source§

fn validate<F: Fn(&T) -> bool>(self, validator: F) -> Validate<T, Self, F>
where Self: Sized,

Validate the parsed value with a predicate
Source§

fn validate_or_critical<F: Fn(&T) -> bool>( self, validator: F, message: &'static str, ) -> ValidateOrCriticalMsg<T, Self, F>
where Self: Sized,

Validate the parsed value with a predicate or return a provided critical error message Read more
Source§

fn validate_or_dynamic_critical<F: Fn(&T) -> Result<(), Cow<'static, str>>>( self, validator: F, ) -> ValidateOrDynamicCriticalMsg<T, Self, F>
where Self: Sized,

Validate the parsed value with a predicate or return a critical error message Read more
Source§

fn debug<F: for<'a, 'b> Fn(DebugType<'a, 'b, T>)>( self, debugger: F, ) -> Debugging<T, Self, F>
where Self: Sized,

Debug the input and output values of the parser using the provided debugger
Source§

fn erase_type(self) -> Box<dyn Parser<T> + Send + Sync>
where Self: Sized + Send + Sync + 'static,

“Erase” the parser’s type Read more
Source§

fn static_ref(&'static self) -> StaticRef<T, Self>
where Self: Sized,

Wrap a static reference to this parser inside a new parser Read more
Source§

impl<L: Parser<Output>, M: Parser<Output>, N: Parser<Output>, O: Parser<Output>, P: Parser<Output>, Q: Parser<Output>, R: Parser<Output>, S: Parser<Output>, T: Parser<Output>, U: Parser<Output>, V: Parser<Output>, W: Parser<Output>, X: Parser<Output>, Y: Parser<Output>, Z: Parser<Output>, Output> Parser<Output> for Choice<(L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z), Output>

Source§

fn parse_inner(&self, input: &mut ParserInput<'_>) -> ParserResult<Output>

Inner parsing function, to implement
Source§

fn parse(&self, input: &mut ParserInput<'_>) -> ParserResult<T>

Parse an input with the current parser Read more
Source§

fn parse_str(&self, str: &str) -> ParserResult<T>

Parse a string Read more
Source§

fn parse_str_with_file_id(&self, str: &str, file_id: FileId) -> ParserResult<T>

Parse a string as a file Read more
Source§

fn then<U, P: Parser<U>>(self, other: P) -> Then<T, Self, U, P>
where Self: Sized,

Chain this parser with another, getting both parsers’ results combined
Source§

fn then_ignore<U, P: Parser<U>>(self, other: P) -> ThenIgnore<T, Self, U, P>
where Self: Sized,

Chain this parser with another but discard the latter’s parsed value
Source§

fn ignore_then<U, P: Parser<U>>(self, other: P) -> IgnoreThen<T, Self, U, P>
where Self: Sized,

Chain this parser with another but discard the former’s parsed value
Source§

fn followed_by<U, P: Parser<U>>(self, other: P) -> FollowedBy<T, Self, U, P>
where Self: Sized,

Only match if this parser succeeds and the provided parser succeeds as well Read more
Source§

fn not_followed_by<U, P: Parser<U>>( self, other: P, ) -> NotFollowedBy<T, Self, U, P>
where Self: Sized,

Only match if this parser succeeds and the provided parser doesn’t
Source§

fn repeated(self) -> Repeated<T, Self, NoAllocContainer>
where Self: Sized,

Parse as many times as possible, until the parser eventually fails Read more
Source§

fn repeated_into_vec(self) -> Repeated<T, Self, Vec<T>>
where Self: Sized,

Parse as many times as possible, until the parser eventually fails Read more
Source§

fn repeated_into_container<C: Container<T>>(self) -> Repeated<T, Self, C>
where Self: Sized,

Parse as many times as possible, until the parser eventually fails Read more
Source§

fn or_not(self) -> OrNot<T, Self>
where Self: Sized,

Try to parse Read more
Source§

fn map<U, F: Fn(T) -> U>(self, mapper: F) -> Map<T, Self, U, F>
where Self: Sized,

Map the parsed value using a function Read more
Source§

fn map_str<U, F: Fn(&str) -> U>(self, mapper: F) -> MapStr<T, Self, U, F>
where Self: Sized,

Get the input string matched by the parser and map it using a function
Source§

fn try_map<U, F: Fn(T) -> Option<U>>(self, mapper: F) -> TryMap<T, Self, U, F>
where Self: Sized,

Try to map the parsed value using a function
Source§

fn and_then<U, F: Fn(T) -> Result<U, ParsingError>>( self, mapper: F, ) -> AndThen<T, Self, U, F>
where Self: Sized,

Transform and validate the parsed value using the provided function Read more
Source§

fn and_then_or_critical<U, F: Fn(T) -> Result<U, Cow<'static, str>>>( self, mapper: F, ) -> AndThenOrCritical<T, Self, U, F>
where Self: Sized,

Transform and validate the parsed value using the provided function Failures are critical
Source§

fn spanned(self) -> Spanned<T, Self>
where Self: Sized,

Wrap the parsed value in a Spanned
Source§

fn collect<C>(self) -> Map<T, Self, C, fn(T) -> C>
where Self: Sized, T: IntoIterator, C: FromIterator<T::Item>,

Collect the parsed value using the provided iterator type
Source§

fn collect_string(self) -> StringCollected<T, Self>
where Self: Sized,

Collect the input string matched by the parser
Source§

fn atomic_err(self, message: &'static str) -> AtomicErr<T, Self>
where Self: Sized,

Provide an atomic error if the parser fails Read more
Source§

fn critical(self, message: &'static str) -> Critical<T, Self>
where Self: Sized,

Mark the parser as critical Read more
Source§

fn critical_auto_msg(self) -> Critical<T, Self>
where Self: Sized,

Mark the parser as critical Read more
Source§

fn silent(self) -> Silenced<T, Self>
where Self: Sized,

Make the parser silent Read more
Source§

fn padded_by<P, PP: Parser<P>>(self, padding: PP) -> Padded<T, Self, P, PP>
where Self: Sized,

Require the parser to be preceded by and followed by the provided padding Read more
Source§

fn line_padded(self) -> LinePadded<T, Self>
where Self: Sized,

Allow the parser to be surrounded by whitespaces (not newlines)
Source§

fn surrounded_by<L, LP: Parser<L>, R, RP: Parser<R>>( self, left: LP, right: RP, ) -> SurroundedBy<L, LP, T, Self, R, RP>
where Self: Sized,

Require the parser to be preceded by and followed by the provided parsers Read more
Source§

fn separated_by<S, P: Parser<S>>( self, sep: P, ) -> SeparatedBy<T, Self, S, P, NoAllocContainer>
where Self: Sized,

Repeat the parser with the required provided separator between each repetition Read more
Source§

fn separated_by_into_vec<S, P: Parser<S>>( self, sep: P, ) -> SeparatedBy<T, Self, S, P, Vec<T>>
where Self: Sized,

Repeat the parser with the required provided separator between each repetition Read more
Source§

fn separated_by_into_container<C: Container<T>, S, P: Parser<S>>( self, sep: P, ) -> SeparatedBy<T, Self, S, P, C>
where Self: Sized,

Repeat the parser with the required provided separator between each repetition Read more
Source§

fn flatten<U, S>(self) -> Flattened<U, S, T, Self, NoAllocContainer>
where Self: Sized, T: IntoIterator<Item = S>, S: IntoIterator<Item = U>,

Flatten the parser Read more
Source§

fn flatten_into_vec<U, S>(self) -> Flattened<U, S, T, Self, Vec<U>>
where Self: Sized, T: IntoIterator<Item = S>, S: IntoIterator<Item = U>,

Flatten the parser Requires the parser to return a nested iterator. Read more
Source§

fn flatten_into_container<U, S, C: Container<U>>( self, ) -> Flattened<U, S, T, Self, C>
where Self: Sized, T: IntoIterator<Item = S>, S: IntoIterator<Item = U>,

Flatten the parser Requires the parser to return a nested iterator. Read more
Source§

fn to<U: Copy>(self, data: U) -> To<T, Self, U>
where Self: Sized,

Discard the parsed value and replace it with a fixed value
Source§

fn full(self) -> Full<T, Self>
where Self: Sized,

Require the parser to match the entire input
Source§

fn or<P: Parser<T>>(self, other: P) -> Choice<(Self, P), T>
where Self: Sized,

Allow the parser to fallback to another parser in case of failure Read more
Source§

fn validate<F: Fn(&T) -> bool>(self, validator: F) -> Validate<T, Self, F>
where Self: Sized,

Validate the parsed value with a predicate
Source§

fn validate_or_critical<F: Fn(&T) -> bool>( self, validator: F, message: &'static str, ) -> ValidateOrCriticalMsg<T, Self, F>
where Self: Sized,

Validate the parsed value with a predicate or return a provided critical error message Read more
Source§

fn validate_or_dynamic_critical<F: Fn(&T) -> Result<(), Cow<'static, str>>>( self, validator: F, ) -> ValidateOrDynamicCriticalMsg<T, Self, F>
where Self: Sized,

Validate the parsed value with a predicate or return a critical error message Read more
Source§

fn debug<F: for<'a, 'b> Fn(DebugType<'a, 'b, T>)>( self, debugger: F, ) -> Debugging<T, Self, F>
where Self: Sized,

Debug the input and output values of the parser using the provided debugger
Source§

fn erase_type(self) -> Box<dyn Parser<T> + Send + Sync>
where Self: Sized + Send + Sync + 'static,

“Erase” the parser’s type Read more
Source§

fn static_ref(&'static self) -> StaticRef<T, Self>
where Self: Sized,

Wrap a static reference to this parser inside a new parser Read more
Source§

impl<M: Parser<Output>, N: Parser<Output>, O: Parser<Output>, P: Parser<Output>, Q: Parser<Output>, R: Parser<Output>, S: Parser<Output>, T: Parser<Output>, U: Parser<Output>, V: Parser<Output>, W: Parser<Output>, X: Parser<Output>, Y: Parser<Output>, Z: Parser<Output>, Output> Parser<Output> for Choice<(M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z), Output>

Source§

fn parse_inner(&self, input: &mut ParserInput<'_>) -> ParserResult<Output>

Inner parsing function, to implement
Source§

fn parse(&self, input: &mut ParserInput<'_>) -> ParserResult<T>

Parse an input with the current parser Read more
Source§

fn parse_str(&self, str: &str) -> ParserResult<T>

Parse a string Read more
Source§

fn parse_str_with_file_id(&self, str: &str, file_id: FileId) -> ParserResult<T>

Parse a string as a file Read more
Source§

fn then<U, P: Parser<U>>(self, other: P) -> Then<T, Self, U, P>
where Self: Sized,

Chain this parser with another, getting both parsers’ results combined
Source§

fn then_ignore<U, P: Parser<U>>(self, other: P) -> ThenIgnore<T, Self, U, P>
where Self: Sized,

Chain this parser with another but discard the latter’s parsed value
Source§

fn ignore_then<U, P: Parser<U>>(self, other: P) -> IgnoreThen<T, Self, U, P>
where Self: Sized,

Chain this parser with another but discard the former’s parsed value
Source§

fn followed_by<U, P: Parser<U>>(self, other: P) -> FollowedBy<T, Self, U, P>
where Self: Sized,

Only match if this parser succeeds and the provided parser succeeds as well Read more
Source§

fn not_followed_by<U, P: Parser<U>>( self, other: P, ) -> NotFollowedBy<T, Self, U, P>
where Self: Sized,

Only match if this parser succeeds and the provided parser doesn’t
Source§

fn repeated(self) -> Repeated<T, Self, NoAllocContainer>
where Self: Sized,

Parse as many times as possible, until the parser eventually fails Read more
Source§

fn repeated_into_vec(self) -> Repeated<T, Self, Vec<T>>
where Self: Sized,

Parse as many times as possible, until the parser eventually fails Read more
Source§

fn repeated_into_container<C: Container<T>>(self) -> Repeated<T, Self, C>
where Self: Sized,

Parse as many times as possible, until the parser eventually fails Read more
Source§

fn or_not(self) -> OrNot<T, Self>
where Self: Sized,

Try to parse Read more
Source§

fn map<U, F: Fn(T) -> U>(self, mapper: F) -> Map<T, Self, U, F>
where Self: Sized,

Map the parsed value using a function Read more
Source§

fn map_str<U, F: Fn(&str) -> U>(self, mapper: F) -> MapStr<T, Self, U, F>
where Self: Sized,

Get the input string matched by the parser and map it using a function
Source§

fn try_map<U, F: Fn(T) -> Option<U>>(self, mapper: F) -> TryMap<T, Self, U, F>
where Self: Sized,

Try to map the parsed value using a function
Source§

fn and_then<U, F: Fn(T) -> Result<U, ParsingError>>( self, mapper: F, ) -> AndThen<T, Self, U, F>
where Self: Sized,

Transform and validate the parsed value using the provided function Read more
Source§

fn and_then_or_critical<U, F: Fn(T) -> Result<U, Cow<'static, str>>>( self, mapper: F, ) -> AndThenOrCritical<T, Self, U, F>
where Self: Sized,

Transform and validate the parsed value using the provided function Failures are critical
Source§

fn spanned(self) -> Spanned<T, Self>
where Self: Sized,

Wrap the parsed value in a Spanned
Source§

fn collect<C>(self) -> Map<T, Self, C, fn(T) -> C>
where Self: Sized, T: IntoIterator, C: FromIterator<T::Item>,

Collect the parsed value using the provided iterator type
Source§

fn collect_string(self) -> StringCollected<T, Self>
where Self: Sized,

Collect the input string matched by the parser
Source§

fn atomic_err(self, message: &'static str) -> AtomicErr<T, Self>
where Self: Sized,

Provide an atomic error if the parser fails Read more
Source§

fn critical(self, message: &'static str) -> Critical<T, Self>
where Self: Sized,

Mark the parser as critical Read more
Source§

fn critical_auto_msg(self) -> Critical<T, Self>
where Self: Sized,

Mark the parser as critical Read more
Source§

fn silent(self) -> Silenced<T, Self>
where Self: Sized,

Make the parser silent Read more
Source§

fn padded_by<P, PP: Parser<P>>(self, padding: PP) -> Padded<T, Self, P, PP>
where Self: Sized,

Require the parser to be preceded by and followed by the provided padding Read more
Source§

fn line_padded(self) -> LinePadded<T, Self>
where Self: Sized,

Allow the parser to be surrounded by whitespaces (not newlines)
Source§

fn surrounded_by<L, LP: Parser<L>, R, RP: Parser<R>>( self, left: LP, right: RP, ) -> SurroundedBy<L, LP, T, Self, R, RP>
where Self: Sized,

Require the parser to be preceded by and followed by the provided parsers Read more
Source§

fn separated_by<S, P: Parser<S>>( self, sep: P, ) -> SeparatedBy<T, Self, S, P, NoAllocContainer>
where Self: Sized,

Repeat the parser with the required provided separator between each repetition Read more
Source§

fn separated_by_into_vec<S, P: Parser<S>>( self, sep: P, ) -> SeparatedBy<T, Self, S, P, Vec<T>>
where Self: Sized,

Repeat the parser with the required provided separator between each repetition Read more
Source§

fn separated_by_into_container<C: Container<T>, S, P: Parser<S>>( self, sep: P, ) -> SeparatedBy<T, Self, S, P, C>
where Self: Sized,

Repeat the parser with the required provided separator between each repetition Read more
Source§

fn flatten<U, S>(self) -> Flattened<U, S, T, Self, NoAllocContainer>
where Self: Sized, T: IntoIterator<Item = S>, S: IntoIterator<Item = U>,

Flatten the parser Read more
Source§

fn flatten_into_vec<U, S>(self) -> Flattened<U, S, T, Self, Vec<U>>
where Self: Sized, T: IntoIterator<Item = S>, S: IntoIterator<Item = U>,

Flatten the parser Requires the parser to return a nested iterator. Read more
Source§

fn flatten_into_container<U, S, C: Container<U>>( self, ) -> Flattened<U, S, T, Self, C>
where Self: Sized, T: IntoIterator<Item = S>, S: IntoIterator<Item = U>,

Flatten the parser Requires the parser to return a nested iterator. Read more
Source§

fn to<U: Copy>(self, data: U) -> To<T, Self, U>
where Self: Sized,

Discard the parsed value and replace it with a fixed value
Source§

fn full(self) -> Full<T, Self>
where Self: Sized,

Require the parser to match the entire input
Source§

fn or<P: Parser<T>>(self, other: P) -> Choice<(Self, P), T>
where Self: Sized,

Allow the parser to fallback to another parser in case of failure Read more
Source§

fn validate<F: Fn(&T) -> bool>(self, validator: F) -> Validate<T, Self, F>
where Self: Sized,

Validate the parsed value with a predicate
Source§

fn validate_or_critical<F: Fn(&T) -> bool>( self, validator: F, message: &'static str, ) -> ValidateOrCriticalMsg<T, Self, F>
where Self: Sized,

Validate the parsed value with a predicate or return a provided critical error message Read more
Source§

fn validate_or_dynamic_critical<F: Fn(&T) -> Result<(), Cow<'static, str>>>( self, validator: F, ) -> ValidateOrDynamicCriticalMsg<T, Self, F>
where Self: Sized,

Validate the parsed value with a predicate or return a critical error message Read more
Source§

fn debug<F: for<'a, 'b> Fn(DebugType<'a, 'b, T>)>( self, debugger: F, ) -> Debugging<T, Self, F>
where Self: Sized,

Debug the input and output values of the parser using the provided debugger
Source§

fn erase_type(self) -> Box<dyn Parser<T> + Send + Sync>
where Self: Sized + Send + Sync + 'static,

“Erase” the parser’s type Read more
Source§

fn static_ref(&'static self) -> StaticRef<T, Self>
where Self: Sized,

Wrap a static reference to this parser inside a new parser Read more
Source§

impl<N: Parser<Output>, O: Parser<Output>, P: Parser<Output>, Q: Parser<Output>, R: Parser<Output>, S: Parser<Output>, T: Parser<Output>, U: Parser<Output>, V: Parser<Output>, W: Parser<Output>, X: Parser<Output>, Y: Parser<Output>, Z: Parser<Output>, Output> Parser<Output> for Choice<(N, O, P, Q, R, S, T, U, V, W, X, Y, Z), Output>

Source§

fn parse_inner(&self, input: &mut ParserInput<'_>) -> ParserResult<Output>

Inner parsing function, to implement
Source§

fn parse(&self, input: &mut ParserInput<'_>) -> ParserResult<T>

Parse an input with the current parser Read more
Source§

fn parse_str(&self, str: &str) -> ParserResult<T>

Parse a string Read more
Source§

fn parse_str_with_file_id(&self, str: &str, file_id: FileId) -> ParserResult<T>

Parse a string as a file Read more
Source§

fn then<U, P: Parser<U>>(self, other: P) -> Then<T, Self, U, P>
where Self: Sized,

Chain this parser with another, getting both parsers’ results combined
Source§

fn then_ignore<U, P: Parser<U>>(self, other: P) -> ThenIgnore<T, Self, U, P>
where Self: Sized,

Chain this parser with another but discard the latter’s parsed value
Source§

fn ignore_then<U, P: Parser<U>>(self, other: P) -> IgnoreThen<T, Self, U, P>
where Self: Sized,

Chain this parser with another but discard the former’s parsed value
Source§

fn followed_by<U, P: Parser<U>>(self, other: P) -> FollowedBy<T, Self, U, P>
where Self: Sized,

Only match if this parser succeeds and the provided parser succeeds as well Read more
Source§

fn not_followed_by<U, P: Parser<U>>( self, other: P, ) -> NotFollowedBy<T, Self, U, P>
where Self: Sized,

Only match if this parser succeeds and the provided parser doesn’t
Source§

fn repeated(self) -> Repeated<T, Self, NoAllocContainer>
where Self: Sized,

Parse as many times as possible, until the parser eventually fails Read more
Source§

fn repeated_into_vec(self) -> Repeated<T, Self, Vec<T>>
where Self: Sized,

Parse as many times as possible, until the parser eventually fails Read more
Source§

fn repeated_into_container<C: Container<T>>(self) -> Repeated<T, Self, C>
where Self: Sized,

Parse as many times as possible, until the parser eventually fails Read more
Source§

fn or_not(self) -> OrNot<T, Self>
where Self: Sized,

Try to parse Read more
Source§

fn map<U, F: Fn(T) -> U>(self, mapper: F) -> Map<T, Self, U, F>
where Self: Sized,

Map the parsed value using a function Read more
Source§

fn map_str<U, F: Fn(&str) -> U>(self, mapper: F) -> MapStr<T, Self, U, F>
where Self: Sized,

Get the input string matched by the parser and map it using a function
Source§

fn try_map<U, F: Fn(T) -> Option<U>>(self, mapper: F) -> TryMap<T, Self, U, F>
where Self: Sized,

Try to map the parsed value using a function
Source§

fn and_then<U, F: Fn(T) -> Result<U, ParsingError>>( self, mapper: F, ) -> AndThen<T, Self, U, F>
where Self: Sized,

Transform and validate the parsed value using the provided function Read more
Source§

fn and_then_or_critical<U, F: Fn(T) -> Result<U, Cow<'static, str>>>( self, mapper: F, ) -> AndThenOrCritical<T, Self, U, F>
where Self: Sized,

Transform and validate the parsed value using the provided function Failures are critical
Source§

fn spanned(self) -> Spanned<T, Self>
where Self: Sized,

Wrap the parsed value in a Spanned
Source§

fn collect<C>(self) -> Map<T, Self, C, fn(T) -> C>
where Self: Sized, T: IntoIterator, C: FromIterator<T::Item>,

Collect the parsed value using the provided iterator type
Source§

fn collect_string(self) -> StringCollected<T, Self>
where Self: Sized,

Collect the input string matched by the parser
Source§

fn atomic_err(self, message: &'static str) -> AtomicErr<T, Self>
where Self: Sized,

Provide an atomic error if the parser fails Read more
Source§

fn critical(self, message: &'static str) -> Critical<T, Self>
where Self: Sized,

Mark the parser as critical Read more
Source§

fn critical_auto_msg(self) -> Critical<T, Self>
where Self: Sized,

Mark the parser as critical Read more
Source§

fn silent(self) -> Silenced<T, Self>
where Self: Sized,

Make the parser silent Read more
Source§

fn padded_by<P, PP: Parser<P>>(self, padding: PP) -> Padded<T, Self, P, PP>
where Self: Sized,

Require the parser to be preceded by and followed by the provided padding Read more
Source§

fn line_padded(self) -> LinePadded<T, Self>
where Self: Sized,

Allow the parser to be surrounded by whitespaces (not newlines)
Source§

fn surrounded_by<L, LP: Parser<L>, R, RP: Parser<R>>( self, left: LP, right: RP, ) -> SurroundedBy<L, LP, T, Self, R, RP>
where Self: Sized,

Require the parser to be preceded by and followed by the provided parsers Read more
Source§

fn separated_by<S, P: Parser<S>>( self, sep: P, ) -> SeparatedBy<T, Self, S, P, NoAllocContainer>
where Self: Sized,

Repeat the parser with the required provided separator between each repetition Read more
Source§

fn separated_by_into_vec<S, P: Parser<S>>( self, sep: P, ) -> SeparatedBy<T, Self, S, P, Vec<T>>
where Self: Sized,

Repeat the parser with the required provided separator between each repetition Read more
Source§

fn separated_by_into_container<C: Container<T>, S, P: Parser<S>>( self, sep: P, ) -> SeparatedBy<T, Self, S, P, C>
where Self: Sized,

Repeat the parser with the required provided separator between each repetition Read more
Source§

fn flatten<U, S>(self) -> Flattened<U, S, T, Self, NoAllocContainer>
where Self: Sized, T: IntoIterator<Item = S>, S: IntoIterator<Item = U>,

Flatten the parser Read more
Source§

fn flatten_into_vec<U, S>(self) -> Flattened<U, S, T, Self, Vec<U>>
where Self: Sized, T: IntoIterator<Item = S>, S: IntoIterator<Item = U>,

Flatten the parser Requires the parser to return a nested iterator. Read more
Source§

fn flatten_into_container<U, S, C: Container<U>>( self, ) -> Flattened<U, S, T, Self, C>
where Self: Sized, T: IntoIterator<Item = S>, S: IntoIterator<Item = U>,

Flatten the parser Requires the parser to return a nested iterator. Read more
Source§

fn to<U: Copy>(self, data: U) -> To<T, Self, U>
where Self: Sized,

Discard the parsed value and replace it with a fixed value
Source§

fn full(self) -> Full<T, Self>
where Self: Sized,

Require the parser to match the entire input
Source§

fn or<P: Parser<T>>(self, other: P) -> Choice<(Self, P), T>
where Self: Sized,

Allow the parser to fallback to another parser in case of failure Read more
Source§

fn validate<F: Fn(&T) -> bool>(self, validator: F) -> Validate<T, Self, F>
where Self: Sized,

Validate the parsed value with a predicate
Source§

fn validate_or_critical<F: Fn(&T) -> bool>( self, validator: F, message: &'static str, ) -> ValidateOrCriticalMsg<T, Self, F>
where Self: Sized,

Validate the parsed value with a predicate or return a provided critical error message Read more
Source§

fn validate_or_dynamic_critical<F: Fn(&T) -> Result<(), Cow<'static, str>>>( self, validator: F, ) -> ValidateOrDynamicCriticalMsg<T, Self, F>
where Self: Sized,

Validate the parsed value with a predicate or return a critical error message Read more
Source§

fn debug<F: for<'a, 'b> Fn(DebugType<'a, 'b, T>)>( self, debugger: F, ) -> Debugging<T, Self, F>
where Self: Sized,

Debug the input and output values of the parser using the provided debugger
Source§

fn erase_type(self) -> Box<dyn Parser<T> + Send + Sync>
where Self: Sized + Send + Sync + 'static,

“Erase” the parser’s type Read more
Source§

fn static_ref(&'static self) -> StaticRef<T, Self>
where Self: Sized,

Wrap a static reference to this parser inside a new parser Read more
Source§

impl<O: Parser<Output>, P: Parser<Output>, Q: Parser<Output>, R: Parser<Output>, S: Parser<Output>, T: Parser<Output>, U: Parser<Output>, V: Parser<Output>, W: Parser<Output>, X: Parser<Output>, Y: Parser<Output>, Z: Parser<Output>, Output> Parser<Output> for Choice<(O, P, Q, R, S, T, U, V, W, X, Y, Z), Output>

Source§

fn parse_inner(&self, input: &mut ParserInput<'_>) -> ParserResult<Output>

Inner parsing function, to implement
Source§

fn parse(&self, input: &mut ParserInput<'_>) -> ParserResult<T>

Parse an input with the current parser Read more
Source§

fn parse_str(&self, str: &str) -> ParserResult<T>

Parse a string Read more
Source§

fn parse_str_with_file_id(&self, str: &str, file_id: FileId) -> ParserResult<T>

Parse a string as a file Read more
Source§

fn then<U, P: Parser<U>>(self, other: P) -> Then<T, Self, U, P>
where Self: Sized,

Chain this parser with another, getting both parsers’ results combined
Source§

fn then_ignore<U, P: Parser<U>>(self, other: P) -> ThenIgnore<T, Self, U, P>
where Self: Sized,

Chain this parser with another but discard the latter’s parsed value
Source§

fn ignore_then<U, P: Parser<U>>(self, other: P) -> IgnoreThen<T, Self, U, P>
where Self: Sized,

Chain this parser with another but discard the former’s parsed value
Source§

fn followed_by<U, P: Parser<U>>(self, other: P) -> FollowedBy<T, Self, U, P>
where Self: Sized,

Only match if this parser succeeds and the provided parser succeeds as well Read more
Source§

fn not_followed_by<U, P: Parser<U>>( self, other: P, ) -> NotFollowedBy<T, Self, U, P>
where Self: Sized,

Only match if this parser succeeds and the provided parser doesn’t
Source§

fn repeated(self) -> Repeated<T, Self, NoAllocContainer>
where Self: Sized,

Parse as many times as possible, until the parser eventually fails Read more
Source§

fn repeated_into_vec(self) -> Repeated<T, Self, Vec<T>>
where Self: Sized,

Parse as many times as possible, until the parser eventually fails Read more
Source§

fn repeated_into_container<C: Container<T>>(self) -> Repeated<T, Self, C>
where Self: Sized,

Parse as many times as possible, until the parser eventually fails Read more
Source§

fn or_not(self) -> OrNot<T, Self>
where Self: Sized,

Try to parse Read more
Source§

fn map<U, F: Fn(T) -> U>(self, mapper: F) -> Map<T, Self, U, F>
where Self: Sized,

Map the parsed value using a function Read more
Source§

fn map_str<U, F: Fn(&str) -> U>(self, mapper: F) -> MapStr<T, Self, U, F>
where Self: Sized,

Get the input string matched by the parser and map it using a function
Source§

fn try_map<U, F: Fn(T) -> Option<U>>(self, mapper: F) -> TryMap<T, Self, U, F>
where Self: Sized,

Try to map the parsed value using a function
Source§

fn and_then<U, F: Fn(T) -> Result<U, ParsingError>>( self, mapper: F, ) -> AndThen<T, Self, U, F>
where Self: Sized,

Transform and validate the parsed value using the provided function Read more
Source§

fn and_then_or_critical<U, F: Fn(T) -> Result<U, Cow<'static, str>>>( self, mapper: F, ) -> AndThenOrCritical<T, Self, U, F>
where Self: Sized,

Transform and validate the parsed value using the provided function Failures are critical
Source§

fn spanned(self) -> Spanned<T, Self>
where Self: Sized,

Wrap the parsed value in a Spanned
Source§

fn collect<C>(self) -> Map<T, Self, C, fn(T) -> C>
where Self: Sized, T: IntoIterator, C: FromIterator<T::Item>,

Collect the parsed value using the provided iterator type
Source§

fn collect_string(self) -> StringCollected<T, Self>
where Self: Sized,

Collect the input string matched by the parser
Source§

fn atomic_err(self, message: &'static str) -> AtomicErr<T, Self>
where Self: Sized,

Provide an atomic error if the parser fails Read more
Source§

fn critical(self, message: &'static str) -> Critical<T, Self>
where Self: Sized,

Mark the parser as critical Read more
Source§

fn critical_auto_msg(self) -> Critical<T, Self>
where Self: Sized,

Mark the parser as critical Read more
Source§

fn silent(self) -> Silenced<T, Self>
where Self: Sized,

Make the parser silent Read more
Source§

fn padded_by<P, PP: Parser<P>>(self, padding: PP) -> Padded<T, Self, P, PP>
where Self: Sized,

Require the parser to be preceded by and followed by the provided padding Read more
Source§

fn line_padded(self) -> LinePadded<T, Self>
where Self: Sized,

Allow the parser to be surrounded by whitespaces (not newlines)
Source§

fn surrounded_by<L, LP: Parser<L>, R, RP: Parser<R>>( self, left: LP, right: RP, ) -> SurroundedBy<L, LP, T, Self, R, RP>
where Self: Sized,

Require the parser to be preceded by and followed by the provided parsers Read more
Source§

fn separated_by<S, P: Parser<S>>( self, sep: P, ) -> SeparatedBy<T, Self, S, P, NoAllocContainer>
where Self: Sized,

Repeat the parser with the required provided separator between each repetition Read more
Source§

fn separated_by_into_vec<S, P: Parser<S>>( self, sep: P, ) -> SeparatedBy<T, Self, S, P, Vec<T>>
where Self: Sized,

Repeat the parser with the required provided separator between each repetition Read more
Source§

fn separated_by_into_container<C: Container<T>, S, P: Parser<S>>( self, sep: P, ) -> SeparatedBy<T, Self, S, P, C>
where Self: Sized,

Repeat the parser with the required provided separator between each repetition Read more
Source§

fn flatten<U, S>(self) -> Flattened<U, S, T, Self, NoAllocContainer>
where Self: Sized, T: IntoIterator<Item = S>, S: IntoIterator<Item = U>,

Flatten the parser Read more
Source§

fn flatten_into_vec<U, S>(self) -> Flattened<U, S, T, Self, Vec<U>>
where Self: Sized, T: IntoIterator<Item = S>, S: IntoIterator<Item = U>,

Flatten the parser Requires the parser to return a nested iterator. Read more
Source§

fn flatten_into_container<U, S, C: Container<U>>( self, ) -> Flattened<U, S, T, Self, C>
where Self: Sized, T: IntoIterator<Item = S>, S: IntoIterator<Item = U>,

Flatten the parser Requires the parser to return a nested iterator. Read more
Source§

fn to<U: Copy>(self, data: U) -> To<T, Self, U>
where Self: Sized,

Discard the parsed value and replace it with a fixed value
Source§

fn full(self) -> Full<T, Self>
where Self: Sized,

Require the parser to match the entire input
Source§

fn or<P: Parser<T>>(self, other: P) -> Choice<(Self, P), T>
where Self: Sized,

Allow the parser to fallback to another parser in case of failure Read more
Source§

fn validate<F: Fn(&T) -> bool>(self, validator: F) -> Validate<T, Self, F>
where Self: Sized,

Validate the parsed value with a predicate
Source§

fn validate_or_critical<F: Fn(&T) -> bool>( self, validator: F, message: &'static str, ) -> ValidateOrCriticalMsg<T, Self, F>
where Self: Sized,

Validate the parsed value with a predicate or return a provided critical error message Read more
Source§

fn validate_or_dynamic_critical<F: Fn(&T) -> Result<(), Cow<'static, str>>>( self, validator: F, ) -> ValidateOrDynamicCriticalMsg<T, Self, F>
where Self: Sized,

Validate the parsed value with a predicate or return a critical error message Read more
Source§

fn debug<F: for<'a, 'b> Fn(DebugType<'a, 'b, T>)>( self, debugger: F, ) -> Debugging<T, Self, F>
where Self: Sized,

Debug the input and output values of the parser using the provided debugger
Source§

fn erase_type(self) -> Box<dyn Parser<T> + Send + Sync>
where Self: Sized + Send + Sync + 'static,

“Erase” the parser’s type Read more
Source§

fn static_ref(&'static self) -> StaticRef<T, Self>
where Self: Sized,

Wrap a static reference to this parser inside a new parser Read more
Source§

impl<P: Parser<Output>, Q: Parser<Output>, R: Parser<Output>, S: Parser<Output>, T: Parser<Output>, U: Parser<Output>, V: Parser<Output>, W: Parser<Output>, X: Parser<Output>, Y: Parser<Output>, Z: Parser<Output>, Output> Parser<Output> for Choice<(P, Q, R, S, T, U, V, W, X, Y, Z), Output>

Source§

fn parse_inner(&self, input: &mut ParserInput<'_>) -> ParserResult<Output>

Inner parsing function, to implement
Source§

fn parse(&self, input: &mut ParserInput<'_>) -> ParserResult<T>

Parse an input with the current parser Read more
Source§

fn parse_str(&self, str: &str) -> ParserResult<T>

Parse a string Read more
Source§

fn parse_str_with_file_id(&self, str: &str, file_id: FileId) -> ParserResult<T>

Parse a string as a file Read more
Source§

fn then<U, P: Parser<U>>(self, other: P) -> Then<T, Self, U, P>
where Self: Sized,

Chain this parser with another, getting both parsers’ results combined
Source§

fn then_ignore<U, P: Parser<U>>(self, other: P) -> ThenIgnore<T, Self, U, P>
where Self: Sized,

Chain this parser with another but discard the latter’s parsed value
Source§

fn ignore_then<U, P: Parser<U>>(self, other: P) -> IgnoreThen<T, Self, U, P>
where Self: Sized,

Chain this parser with another but discard the former’s parsed value
Source§

fn followed_by<U, P: Parser<U>>(self, other: P) -> FollowedBy<T, Self, U, P>
where Self: Sized,

Only match if this parser succeeds and the provided parser succeeds as well Read more
Source§

fn not_followed_by<U, P: Parser<U>>( self, other: P, ) -> NotFollowedBy<T, Self, U, P>
where Self: Sized,

Only match if this parser succeeds and the provided parser doesn’t
Source§

fn repeated(self) -> Repeated<T, Self, NoAllocContainer>
where Self: Sized,

Parse as many times as possible, until the parser eventually fails Read more
Source§

fn repeated_into_vec(self) -> Repeated<T, Self, Vec<T>>
where Self: Sized,

Parse as many times as possible, until the parser eventually fails Read more
Source§

fn repeated_into_container<C: Container<T>>(self) -> Repeated<T, Self, C>
where Self: Sized,

Parse as many times as possible, until the parser eventually fails Read more
Source§

fn or_not(self) -> OrNot<T, Self>
where Self: Sized,

Try to parse Read more
Source§

fn map<U, F: Fn(T) -> U>(self, mapper: F) -> Map<T, Self, U, F>
where Self: Sized,

Map the parsed value using a function Read more
Source§

fn map_str<U, F: Fn(&str) -> U>(self, mapper: F) -> MapStr<T, Self, U, F>
where Self: Sized,

Get the input string matched by the parser and map it using a function
Source§

fn try_map<U, F: Fn(T) -> Option<U>>(self, mapper: F) -> TryMap<T, Self, U, F>
where Self: Sized,

Try to map the parsed value using a function
Source§

fn and_then<U, F: Fn(T) -> Result<U, ParsingError>>( self, mapper: F, ) -> AndThen<T, Self, U, F>
where Self: Sized,

Transform and validate the parsed value using the provided function Read more
Source§

fn and_then_or_critical<U, F: Fn(T) -> Result<U, Cow<'static, str>>>( self, mapper: F, ) -> AndThenOrCritical<T, Self, U, F>
where Self: Sized,

Transform and validate the parsed value using the provided function Failures are critical
Source§

fn spanned(self) -> Spanned<T, Self>
where Self: Sized,

Wrap the parsed value in a Spanned
Source§

fn collect<C>(self) -> Map<T, Self, C, fn(T) -> C>
where Self: Sized, T: IntoIterator, C: FromIterator<T::Item>,

Collect the parsed value using the provided iterator type
Source§

fn collect_string(self) -> StringCollected<T, Self>
where Self: Sized,

Collect the input string matched by the parser
Source§

fn atomic_err(self, message: &'static str) -> AtomicErr<T, Self>
where Self: Sized,

Provide an atomic error if the parser fails Read more
Source§

fn critical(self, message: &'static str) -> Critical<T, Self>
where Self: Sized,

Mark the parser as critical Read more
Source§

fn critical_auto_msg(self) -> Critical<T, Self>
where Self: Sized,

Mark the parser as critical Read more
Source§

fn silent(self) -> Silenced<T, Self>
where Self: Sized,

Make the parser silent Read more
Source§

fn padded_by<P, PP: Parser<P>>(self, padding: PP) -> Padded<T, Self, P, PP>
where Self: Sized,

Require the parser to be preceded by and followed by the provided padding Read more
Source§

fn line_padded(self) -> LinePadded<T, Self>
where Self: Sized,

Allow the parser to be surrounded by whitespaces (not newlines)
Source§

fn surrounded_by<L, LP: Parser<L>, R, RP: Parser<R>>( self, left: LP, right: RP, ) -> SurroundedBy<L, LP, T, Self, R, RP>
where Self: Sized,

Require the parser to be preceded by and followed by the provided parsers Read more
Source§

fn separated_by<S, P: Parser<S>>( self, sep: P, ) -> SeparatedBy<T, Self, S, P, NoAllocContainer>
where Self: Sized,

Repeat the parser with the required provided separator between each repetition Read more
Source§

fn separated_by_into_vec<S, P: Parser<S>>( self, sep: P, ) -> SeparatedBy<T, Self, S, P, Vec<T>>
where Self: Sized,

Repeat the parser with the required provided separator between each repetition Read more
Source§

fn separated_by_into_container<C: Container<T>, S, P: Parser<S>>( self, sep: P, ) -> SeparatedBy<T, Self, S, P, C>
where Self: Sized,

Repeat the parser with the required provided separator between each repetition Read more
Source§

fn flatten<U, S>(self) -> Flattened<U, S, T, Self, NoAllocContainer>
where Self: Sized, T: IntoIterator<Item = S>, S: IntoIterator<Item = U>,

Flatten the parser Read more
Source§

fn flatten_into_vec<U, S>(self) -> Flattened<U, S, T, Self, Vec<U>>
where Self: Sized, T: IntoIterator<Item = S>, S: IntoIterator<Item = U>,

Flatten the parser Requires the parser to return a nested iterator. Read more
Source§

fn flatten_into_container<U, S, C: Container<U>>( self, ) -> Flattened<U, S, T, Self, C>
where Self: Sized, T: IntoIterator<Item = S>, S: IntoIterator<Item = U>,

Flatten the parser Requires the parser to return a nested iterator. Read more
Source§

fn to<U: Copy>(self, data: U) -> To<T, Self, U>
where Self: Sized,

Discard the parsed value and replace it with a fixed value
Source§

fn full(self) -> Full<T, Self>
where Self: Sized,

Require the parser to match the entire input
Source§

fn or<P: Parser<T>>(self, other: P) -> Choice<(Self, P), T>
where Self: Sized,

Allow the parser to fallback to another parser in case of failure Read more
Source§

fn validate<F: Fn(&T) -> bool>(self, validator: F) -> Validate<T, Self, F>
where Self: Sized,

Validate the parsed value with a predicate
Source§

fn validate_or_critical<F: Fn(&T) -> bool>( self, validator: F, message: &'static str, ) -> ValidateOrCriticalMsg<T, Self, F>
where Self: Sized,

Validate the parsed value with a predicate or return a provided critical error message Read more
Source§

fn validate_or_dynamic_critical<F: Fn(&T) -> Result<(), Cow<'static, str>>>( self, validator: F, ) -> ValidateOrDynamicCriticalMsg<T, Self, F>
where Self: Sized,

Validate the parsed value with a predicate or return a critical error message Read more
Source§

fn debug<F: for<'a, 'b> Fn(DebugType<'a, 'b, T>)>( self, debugger: F, ) -> Debugging<T, Self, F>
where Self: Sized,

Debug the input and output values of the parser using the provided debugger
Source§

fn erase_type(self) -> Box<dyn Parser<T> + Send + Sync>
where Self: Sized + Send + Sync + 'static,

“Erase” the parser’s type Read more
Source§

fn static_ref(&'static self) -> StaticRef<T, Self>
where Self: Sized,

Wrap a static reference to this parser inside a new parser Read more
Source§

impl<Q: Parser<Output>, R: Parser<Output>, S: Parser<Output>, T: Parser<Output>, U: Parser<Output>, V: Parser<Output>, W: Parser<Output>, X: Parser<Output>, Y: Parser<Output>, Z: Parser<Output>, Output> Parser<Output> for Choice<(Q, R, S, T, U, V, W, X, Y, Z), Output>

Source§

fn parse_inner(&self, input: &mut ParserInput<'_>) -> ParserResult<Output>

Inner parsing function, to implement
Source§

fn parse(&self, input: &mut ParserInput<'_>) -> ParserResult<T>

Parse an input with the current parser Read more
Source§

fn parse_str(&self, str: &str) -> ParserResult<T>

Parse a string Read more
Source§

fn parse_str_with_file_id(&self, str: &str, file_id: FileId) -> ParserResult<T>

Parse a string as a file Read more
Source§

fn then<U, P: Parser<U>>(self, other: P) -> Then<T, Self, U, P>
where Self: Sized,

Chain this parser with another, getting both parsers’ results combined
Source§

fn then_ignore<U, P: Parser<U>>(self, other: P) -> ThenIgnore<T, Self, U, P>
where Self: Sized,

Chain this parser with another but discard the latter’s parsed value
Source§

fn ignore_then<U, P: Parser<U>>(self, other: P) -> IgnoreThen<T, Self, U, P>
where Self: Sized,

Chain this parser with another but discard the former’s parsed value
Source§

fn followed_by<U, P: Parser<U>>(self, other: P) -> FollowedBy<T, Self, U, P>
where Self: Sized,

Only match if this parser succeeds and the provided parser succeeds as well Read more
Source§

fn not_followed_by<U, P: Parser<U>>( self, other: P, ) -> NotFollowedBy<T, Self, U, P>
where Self: Sized,

Only match if this parser succeeds and the provided parser doesn’t
Source§

fn repeated(self) -> Repeated<T, Self, NoAllocContainer>
where Self: Sized,

Parse as many times as possible, until the parser eventually fails Read more
Source§

fn repeated_into_vec(self) -> Repeated<T, Self, Vec<T>>
where Self: Sized,

Parse as many times as possible, until the parser eventually fails Read more
Source§

fn repeated_into_container<C: Container<T>>(self) -> Repeated<T, Self, C>
where Self: Sized,

Parse as many times as possible, until the parser eventually fails Read more
Source§

fn or_not(self) -> OrNot<T, Self>
where Self: Sized,

Try to parse Read more
Source§

fn map<U, F: Fn(T) -> U>(self, mapper: F) -> Map<T, Self, U, F>
where Self: Sized,

Map the parsed value using a function Read more
Source§

fn map_str<U, F: Fn(&str) -> U>(self, mapper: F) -> MapStr<T, Self, U, F>
where Self: Sized,

Get the input string matched by the parser and map it using a function
Source§

fn try_map<U, F: Fn(T) -> Option<U>>(self, mapper: F) -> TryMap<T, Self, U, F>
where Self: Sized,

Try to map the parsed value using a function
Source§

fn and_then<U, F: Fn(T) -> Result<U, ParsingError>>( self, mapper: F, ) -> AndThen<T, Self, U, F>
where Self: Sized,

Transform and validate the parsed value using the provided function Read more
Source§

fn and_then_or_critical<U, F: Fn(T) -> Result<U, Cow<'static, str>>>( self, mapper: F, ) -> AndThenOrCritical<T, Self, U, F>
where Self: Sized,

Transform and validate the parsed value using the provided function Failures are critical
Source§

fn spanned(self) -> Spanned<T, Self>
where Self: Sized,

Wrap the parsed value in a Spanned
Source§

fn collect<C>(self) -> Map<T, Self, C, fn(T) -> C>
where Self: Sized, T: IntoIterator, C: FromIterator<T::Item>,

Collect the parsed value using the provided iterator type
Source§

fn collect_string(self) -> StringCollected<T, Self>
where Self: Sized,

Collect the input string matched by the parser
Source§

fn atomic_err(self, message: &'static str) -> AtomicErr<T, Self>
where Self: Sized,

Provide an atomic error if the parser fails Read more
Source§

fn critical(self, message: &'static str) -> Critical<T, Self>
where Self: Sized,

Mark the parser as critical Read more
Source§

fn critical_auto_msg(self) -> Critical<T, Self>
where Self: Sized,

Mark the parser as critical Read more
Source§

fn silent(self) -> Silenced<T, Self>
where Self: Sized,

Make the parser silent Read more
Source§

fn padded_by<P, PP: Parser<P>>(self, padding: PP) -> Padded<T, Self, P, PP>
where Self: Sized,

Require the parser to be preceded by and followed by the provided padding Read more
Source§

fn line_padded(self) -> LinePadded<T, Self>
where Self: Sized,

Allow the parser to be surrounded by whitespaces (not newlines)
Source§

fn surrounded_by<L, LP: Parser<L>, R, RP: Parser<R>>( self, left: LP, right: RP, ) -> SurroundedBy<L, LP, T, Self, R, RP>
where Self: Sized,

Require the parser to be preceded by and followed by the provided parsers Read more
Source§

fn separated_by<S, P: Parser<S>>( self, sep: P, ) -> SeparatedBy<T, Self, S, P, NoAllocContainer>
where Self: Sized,

Repeat the parser with the required provided separator between each repetition Read more
Source§

fn separated_by_into_vec<S, P: Parser<S>>( self, sep: P, ) -> SeparatedBy<T, Self, S, P, Vec<T>>
where Self: Sized,

Repeat the parser with the required provided separator between each repetition Read more
Source§

fn separated_by_into_container<C: Container<T>, S, P: Parser<S>>( self, sep: P, ) -> SeparatedBy<T, Self, S, P, C>
where Self: Sized,

Repeat the parser with the required provided separator between each repetition Read more
Source§

fn flatten<U, S>(self) -> Flattened<U, S, T, Self, NoAllocContainer>
where Self: Sized, T: IntoIterator<Item = S>, S: IntoIterator<Item = U>,

Flatten the parser Read more
Source§

fn flatten_into_vec<U, S>(self) -> Flattened<U, S, T, Self, Vec<U>>
where Self: Sized, T: IntoIterator<Item = S>, S: IntoIterator<Item = U>,

Flatten the parser Requires the parser to return a nested iterator. Read more
Source§

fn flatten_into_container<U, S, C: Container<U>>( self, ) -> Flattened<U, S, T, Self, C>
where Self: Sized, T: IntoIterator<Item = S>, S: IntoIterator<Item = U>,

Flatten the parser Requires the parser to return a nested iterator. Read more
Source§

fn to<U: Copy>(self, data: U) -> To<T, Self, U>
where Self: Sized,

Discard the parsed value and replace it with a fixed value
Source§

fn full(self) -> Full<T, Self>
where Self: Sized,

Require the parser to match the entire input
Source§

fn or<P: Parser<T>>(self, other: P) -> Choice<(Self, P), T>
where Self: Sized,

Allow the parser to fallback to another parser in case of failure Read more
Source§

fn validate<F: Fn(&T) -> bool>(self, validator: F) -> Validate<T, Self, F>
where Self: Sized,

Validate the parsed value with a predicate
Source§

fn validate_or_critical<F: Fn(&T) -> bool>( self, validator: F, message: &'static str, ) -> ValidateOrCriticalMsg<T, Self, F>
where Self: Sized,

Validate the parsed value with a predicate or return a provided critical error message Read more
Source§

fn validate_or_dynamic_critical<F: Fn(&T) -> Result<(), Cow<'static, str>>>( self, validator: F, ) -> ValidateOrDynamicCriticalMsg<T, Self, F>
where Self: Sized,

Validate the parsed value with a predicate or return a critical error message Read more
Source§

fn debug<F: for<'a, 'b> Fn(DebugType<'a, 'b, T>)>( self, debugger: F, ) -> Debugging<T, Self, F>
where Self: Sized,

Debug the input and output values of the parser using the provided debugger
Source§

fn erase_type(self) -> Box<dyn Parser<T> + Send + Sync>
where Self: Sized + Send + Sync + 'static,

“Erase” the parser’s type Read more
Source§

fn static_ref(&'static self) -> StaticRef<T, Self>
where Self: Sized,

Wrap a static reference to this parser inside a new parser Read more
Source§

impl<R: Parser<Output>, S: Parser<Output>, T: Parser<Output>, U: Parser<Output>, V: Parser<Output>, W: Parser<Output>, X: Parser<Output>, Y: Parser<Output>, Z: Parser<Output>, Output> Parser<Output> for Choice<(R, S, T, U, V, W, X, Y, Z), Output>

Source§

fn parse_inner(&self, input: &mut ParserInput<'_>) -> ParserResult<Output>

Inner parsing function, to implement
Source§

fn parse(&self, input: &mut ParserInput<'_>) -> ParserResult<T>

Parse an input with the current parser Read more
Source§

fn parse_str(&self, str: &str) -> ParserResult<T>

Parse a string Read more
Source§

fn parse_str_with_file_id(&self, str: &str, file_id: FileId) -> ParserResult<T>

Parse a string as a file Read more
Source§

fn then<U, P: Parser<U>>(self, other: P) -> Then<T, Self, U, P>
where Self: Sized,

Chain this parser with another, getting both parsers’ results combined
Source§

fn then_ignore<U, P: Parser<U>>(self, other: P) -> ThenIgnore<T, Self, U, P>
where Self: Sized,

Chain this parser with another but discard the latter’s parsed value
Source§

fn ignore_then<U, P: Parser<U>>(self, other: P) -> IgnoreThen<T, Self, U, P>
where Self: Sized,

Chain this parser with another but discard the former’s parsed value
Source§

fn followed_by<U, P: Parser<U>>(self, other: P) -> FollowedBy<T, Self, U, P>
where Self: Sized,

Only match if this parser succeeds and the provided parser succeeds as well Read more
Source§

fn not_followed_by<U, P: Parser<U>>( self, other: P, ) -> NotFollowedBy<T, Self, U, P>
where Self: Sized,

Only match if this parser succeeds and the provided parser doesn’t
Source§

fn repeated(self) -> Repeated<T, Self, NoAllocContainer>
where Self: Sized,

Parse as many times as possible, until the parser eventually fails Read more
Source§

fn repeated_into_vec(self) -> Repeated<T, Self, Vec<T>>
where Self: Sized,

Parse as many times as possible, until the parser eventually fails Read more
Source§

fn repeated_into_container<C: Container<T>>(self) -> Repeated<T, Self, C>
where Self: Sized,

Parse as many times as possible, until the parser eventually fails Read more
Source§

fn or_not(self) -> OrNot<T, Self>
where Self: Sized,

Try to parse Read more
Source§

fn map<U, F: Fn(T) -> U>(self, mapper: F) -> Map<T, Self, U, F>
where Self: Sized,

Map the parsed value using a function Read more
Source§

fn map_str<U, F: Fn(&str) -> U>(self, mapper: F) -> MapStr<T, Self, U, F>
where Self: Sized,

Get the input string matched by the parser and map it using a function
Source§

fn try_map<U, F: Fn(T) -> Option<U>>(self, mapper: F) -> TryMap<T, Self, U, F>
where Self: Sized,

Try to map the parsed value using a function
Source§

fn and_then<U, F: Fn(T) -> Result<U, ParsingError>>( self, mapper: F, ) -> AndThen<T, Self, U, F>
where Self: Sized,

Transform and validate the parsed value using the provided function Read more
Source§

fn and_then_or_critical<U, F: Fn(T) -> Result<U, Cow<'static, str>>>( self, mapper: F, ) -> AndThenOrCritical<T, Self, U, F>
where Self: Sized,

Transform and validate the parsed value using the provided function Failures are critical
Source§

fn spanned(self) -> Spanned<T, Self>
where Self: Sized,

Wrap the parsed value in a Spanned
Source§

fn collect<C>(self) -> Map<T, Self, C, fn(T) -> C>
where Self: Sized, T: IntoIterator, C: FromIterator<T::Item>,

Collect the parsed value using the provided iterator type
Source§

fn collect_string(self) -> StringCollected<T, Self>
where Self: Sized,

Collect the input string matched by the parser
Source§

fn atomic_err(self, message: &'static str) -> AtomicErr<T, Self>
where Self: Sized,

Provide an atomic error if the parser fails Read more
Source§

fn critical(self, message: &'static str) -> Critical<T, Self>
where Self: Sized,

Mark the parser as critical Read more
Source§

fn critical_auto_msg(self) -> Critical<T, Self>
where Self: Sized,

Mark the parser as critical Read more
Source§

fn silent(self) -> Silenced<T, Self>
where Self: Sized,

Make the parser silent Read more
Source§

fn padded_by<P, PP: Parser<P>>(self, padding: PP) -> Padded<T, Self, P, PP>
where Self: Sized,

Require the parser to be preceded by and followed by the provided padding Read more
Source§

fn line_padded(self) -> LinePadded<T, Self>
where Self: Sized,

Allow the parser to be surrounded by whitespaces (not newlines)
Source§

fn surrounded_by<L, LP: Parser<L>, R, RP: Parser<R>>( self, left: LP, right: RP, ) -> SurroundedBy<L, LP, T, Self, R, RP>
where Self: Sized,

Require the parser to be preceded by and followed by the provided parsers Read more
Source§

fn separated_by<S, P: Parser<S>>( self, sep: P, ) -> SeparatedBy<T, Self, S, P, NoAllocContainer>
where Self: Sized,

Repeat the parser with the required provided separator between each repetition Read more
Source§

fn separated_by_into_vec<S, P: Parser<S>>( self, sep: P, ) -> SeparatedBy<T, Self, S, P, Vec<T>>
where Self: Sized,

Repeat the parser with the required provided separator between each repetition Read more
Source§

fn separated_by_into_container<C: Container<T>, S, P: Parser<S>>( self, sep: P, ) -> SeparatedBy<T, Self, S, P, C>
where Self: Sized,

Repeat the parser with the required provided separator between each repetition Read more
Source§

fn flatten<U, S>(self) -> Flattened<U, S, T, Self, NoAllocContainer>
where Self: Sized, T: IntoIterator<Item = S>, S: IntoIterator<Item = U>,

Flatten the parser Read more
Source§

fn flatten_into_vec<U, S>(self) -> Flattened<U, S, T, Self, Vec<U>>
where Self: Sized, T: IntoIterator<Item = S>, S: IntoIterator<Item = U>,

Flatten the parser Requires the parser to return a nested iterator. Read more
Source§

fn flatten_into_container<U, S, C: Container<U>>( self, ) -> Flattened<U, S, T, Self, C>
where Self: Sized, T: IntoIterator<Item = S>, S: IntoIterator<Item = U>,

Flatten the parser Requires the parser to return a nested iterator. Read more
Source§

fn to<U: Copy>(self, data: U) -> To<T, Self, U>
where Self: Sized,

Discard the parsed value and replace it with a fixed value
Source§

fn full(self) -> Full<T, Self>
where Self: Sized,

Require the parser to match the entire input
Source§

fn or<P: Parser<T>>(self, other: P) -> Choice<(Self, P), T>
where Self: Sized,

Allow the parser to fallback to another parser in case of failure Read more
Source§

fn validate<F: Fn(&T) -> bool>(self, validator: F) -> Validate<T, Self, F>
where Self: Sized,

Validate the parsed value with a predicate
Source§

fn validate_or_critical<F: Fn(&T) -> bool>( self, validator: F, message: &'static str, ) -> ValidateOrCriticalMsg<T, Self, F>
where Self: Sized,

Validate the parsed value with a predicate or return a provided critical error message Read more
Source§

fn validate_or_dynamic_critical<F: Fn(&T) -> Result<(), Cow<'static, str>>>( self, validator: F, ) -> ValidateOrDynamicCriticalMsg<T, Self, F>
where Self: Sized,

Validate the parsed value with a predicate or return a critical error message Read more
Source§

fn debug<F: for<'a, 'b> Fn(DebugType<'a, 'b, T>)>( self, debugger: F, ) -> Debugging<T, Self, F>
where Self: Sized,

Debug the input and output values of the parser using the provided debugger
Source§

fn erase_type(self) -> Box<dyn Parser<T> + Send + Sync>
where Self: Sized + Send + Sync + 'static,

“Erase” the parser’s type Read more
Source§

fn static_ref(&'static self) -> StaticRef<T, Self>
where Self: Sized,

Wrap a static reference to this parser inside a new parser Read more
Source§

impl<S: Parser<Output>, T: Parser<Output>, U: Parser<Output>, V: Parser<Output>, W: Parser<Output>, X: Parser<Output>, Y: Parser<Output>, Z: Parser<Output>, Output> Parser<Output> for Choice<(S, T, U, V, W, X, Y, Z), Output>

Source§

fn parse_inner(&self, input: &mut ParserInput<'_>) -> ParserResult<Output>

Inner parsing function, to implement
Source§

fn parse(&self, input: &mut ParserInput<'_>) -> ParserResult<T>

Parse an input with the current parser Read more
Source§

fn parse_str(&self, str: &str) -> ParserResult<T>

Parse a string Read more
Source§

fn parse_str_with_file_id(&self, str: &str, file_id: FileId) -> ParserResult<T>

Parse a string as a file Read more
Source§

fn then<U, P: Parser<U>>(self, other: P) -> Then<T, Self, U, P>
where Self: Sized,

Chain this parser with another, getting both parsers’ results combined
Source§

fn then_ignore<U, P: Parser<U>>(self, other: P) -> ThenIgnore<T, Self, U, P>
where Self: Sized,

Chain this parser with another but discard the latter’s parsed value
Source§

fn ignore_then<U, P: Parser<U>>(self, other: P) -> IgnoreThen<T, Self, U, P>
where Self: Sized,

Chain this parser with another but discard the former’s parsed value
Source§

fn followed_by<U, P: Parser<U>>(self, other: P) -> FollowedBy<T, Self, U, P>
where Self: Sized,

Only match if this parser succeeds and the provided parser succeeds as well Read more
Source§

fn not_followed_by<U, P: Parser<U>>( self, other: P, ) -> NotFollowedBy<T, Self, U, P>
where Self: Sized,

Only match if this parser succeeds and the provided parser doesn’t
Source§

fn repeated(self) -> Repeated<T, Self, NoAllocContainer>
where Self: Sized,

Parse as many times as possible, until the parser eventually fails Read more
Source§

fn repeated_into_vec(self) -> Repeated<T, Self, Vec<T>>
where Self: Sized,

Parse as many times as possible, until the parser eventually fails Read more
Source§

fn repeated_into_container<C: Container<T>>(self) -> Repeated<T, Self, C>
where Self: Sized,

Parse as many times as possible, until the parser eventually fails Read more
Source§

fn or_not(self) -> OrNot<T, Self>
where Self: Sized,

Try to parse Read more
Source§

fn map<U, F: Fn(T) -> U>(self, mapper: F) -> Map<T, Self, U, F>
where Self: Sized,

Map the parsed value using a function Read more
Source§

fn map_str<U, F: Fn(&str) -> U>(self, mapper: F) -> MapStr<T, Self, U, F>
where Self: Sized,

Get the input string matched by the parser and map it using a function
Source§

fn try_map<U, F: Fn(T) -> Option<U>>(self, mapper: F) -> TryMap<T, Self, U, F>
where Self: Sized,

Try to map the parsed value using a function
Source§

fn and_then<U, F: Fn(T) -> Result<U, ParsingError>>( self, mapper: F, ) -> AndThen<T, Self, U, F>
where Self: Sized,

Transform and validate the parsed value using the provided function Read more
Source§

fn and_then_or_critical<U, F: Fn(T) -> Result<U, Cow<'static, str>>>( self, mapper: F, ) -> AndThenOrCritical<T, Self, U, F>
where Self: Sized,

Transform and validate the parsed value using the provided function Failures are critical
Source§

fn spanned(self) -> Spanned<T, Self>
where Self: Sized,

Wrap the parsed value in a Spanned
Source§

fn collect<C>(self) -> Map<T, Self, C, fn(T) -> C>
where Self: Sized, T: IntoIterator, C: FromIterator<T::Item>,

Collect the parsed value using the provided iterator type
Source§

fn collect_string(self) -> StringCollected<T, Self>
where Self: Sized,

Collect the input string matched by the parser
Source§

fn atomic_err(self, message: &'static str) -> AtomicErr<T, Self>
where Self: Sized,

Provide an atomic error if the parser fails Read more
Source§

fn critical(self, message: &'static str) -> Critical<T, Self>
where Self: Sized,

Mark the parser as critical Read more
Source§

fn critical_auto_msg(self) -> Critical<T, Self>
where Self: Sized,

Mark the parser as critical Read more
Source§

fn silent(self) -> Silenced<T, Self>
where Self: Sized,

Make the parser silent Read more
Source§

fn padded_by<P, PP: Parser<P>>(self, padding: PP) -> Padded<T, Self, P, PP>
where Self: Sized,

Require the parser to be preceded by and followed by the provided padding Read more
Source§

fn line_padded(self) -> LinePadded<T, Self>
where Self: Sized,

Allow the parser to be surrounded by whitespaces (not newlines)
Source§

fn surrounded_by<L, LP: Parser<L>, R, RP: Parser<R>>( self, left: LP, right: RP, ) -> SurroundedBy<L, LP, T, Self, R, RP>
where Self: Sized,

Require the parser to be preceded by and followed by the provided parsers Read more
Source§

fn separated_by<S, P: Parser<S>>( self, sep: P, ) -> SeparatedBy<T, Self, S, P, NoAllocContainer>
where Self: Sized,

Repeat the parser with the required provided separator between each repetition Read more
Source§

fn separated_by_into_vec<S, P: Parser<S>>( self, sep: P, ) -> SeparatedBy<T, Self, S, P, Vec<T>>
where Self: Sized,

Repeat the parser with the required provided separator between each repetition Read more
Source§

fn separated_by_into_container<C: Container<T>, S, P: Parser<S>>( self, sep: P, ) -> SeparatedBy<T, Self, S, P, C>
where Self: Sized,

Repeat the parser with the required provided separator between each repetition Read more
Source§

fn flatten<U, S>(self) -> Flattened<U, S, T, Self, NoAllocContainer>
where Self: Sized, T: IntoIterator<Item = S>, S: IntoIterator<Item = U>,

Flatten the parser Read more
Source§

fn flatten_into_vec<U, S>(self) -> Flattened<U, S, T, Self, Vec<U>>
where Self: Sized, T: IntoIterator<Item = S>, S: IntoIterator<Item = U>,

Flatten the parser Requires the parser to return a nested iterator. Read more
Source§

fn flatten_into_container<U, S, C: Container<U>>( self, ) -> Flattened<U, S, T, Self, C>
where Self: Sized, T: IntoIterator<Item = S>, S: IntoIterator<Item = U>,

Flatten the parser Requires the parser to return a nested iterator. Read more
Source§

fn to<U: Copy>(self, data: U) -> To<T, Self, U>
where Self: Sized,

Discard the parsed value and replace it with a fixed value
Source§

fn full(self) -> Full<T, Self>
where Self: Sized,

Require the parser to match the entire input
Source§

fn or<P: Parser<T>>(self, other: P) -> Choice<(Self, P), T>
where Self: Sized,

Allow the parser to fallback to another parser in case of failure Read more
Source§

fn validate<F: Fn(&T) -> bool>(self, validator: F) -> Validate<T, Self, F>
where Self: Sized,

Validate the parsed value with a predicate
Source§

fn validate_or_critical<F: Fn(&T) -> bool>( self, validator: F, message: &'static str, ) -> ValidateOrCriticalMsg<T, Self, F>
where Self: Sized,

Validate the parsed value with a predicate or return a provided critical error message Read more
Source§

fn validate_or_dynamic_critical<F: Fn(&T) -> Result<(), Cow<'static, str>>>( self, validator: F, ) -> ValidateOrDynamicCriticalMsg<T, Self, F>
where Self: Sized,

Validate the parsed value with a predicate or return a critical error message Read more
Source§

fn debug<F: for<'a, 'b> Fn(DebugType<'a, 'b, T>)>( self, debugger: F, ) -> Debugging<T, Self, F>
where Self: Sized,

Debug the input and output values of the parser using the provided debugger
Source§

fn erase_type(self) -> Box<dyn Parser<T> + Send + Sync>
where Self: Sized + Send + Sync + 'static,

“Erase” the parser’s type Read more
Source§

fn static_ref(&'static self) -> StaticRef<T, Self>
where Self: Sized,

Wrap a static reference to this parser inside a new parser Read more
Source§

impl<T: Parser<Output>, U: Parser<Output>, V: Parser<Output>, W: Parser<Output>, X: Parser<Output>, Y: Parser<Output>, Z: Parser<Output>, Output> Parser<Output> for Choice<(T, U, V, W, X, Y, Z), Output>

Source§

fn parse_inner(&self, input: &mut ParserInput<'_>) -> ParserResult<Output>

Inner parsing function, to implement
Source§

fn parse(&self, input: &mut ParserInput<'_>) -> ParserResult<T>

Parse an input with the current parser Read more
Source§

fn parse_str(&self, str: &str) -> ParserResult<T>

Parse a string Read more
Source§

fn parse_str_with_file_id(&self, str: &str, file_id: FileId) -> ParserResult<T>

Parse a string as a file Read more
Source§

fn then<U, P: Parser<U>>(self, other: P) -> Then<T, Self, U, P>
where Self: Sized,

Chain this parser with another, getting both parsers’ results combined
Source§

fn then_ignore<U, P: Parser<U>>(self, other: P) -> ThenIgnore<T, Self, U, P>
where Self: Sized,

Chain this parser with another but discard the latter’s parsed value
Source§

fn ignore_then<U, P: Parser<U>>(self, other: P) -> IgnoreThen<T, Self, U, P>
where Self: Sized,

Chain this parser with another but discard the former’s parsed value
Source§

fn followed_by<U, P: Parser<U>>(self, other: P) -> FollowedBy<T, Self, U, P>
where Self: Sized,

Only match if this parser succeeds and the provided parser succeeds as well Read more
Source§

fn not_followed_by<U, P: Parser<U>>( self, other: P, ) -> NotFollowedBy<T, Self, U, P>
where Self: Sized,

Only match if this parser succeeds and the provided parser doesn’t
Source§

fn repeated(self) -> Repeated<T, Self, NoAllocContainer>
where Self: Sized,

Parse as many times as possible, until the parser eventually fails Read more
Source§

fn repeated_into_vec(self) -> Repeated<T, Self, Vec<T>>
where Self: Sized,

Parse as many times as possible, until the parser eventually fails Read more
Source§

fn repeated_into_container<C: Container<T>>(self) -> Repeated<T, Self, C>
where Self: Sized,

Parse as many times as possible, until the parser eventually fails Read more
Source§

fn or_not(self) -> OrNot<T, Self>
where Self: Sized,

Try to parse Read more
Source§

fn map<U, F: Fn(T) -> U>(self, mapper: F) -> Map<T, Self, U, F>
where Self: Sized,

Map the parsed value using a function Read more
Source§

fn map_str<U, F: Fn(&str) -> U>(self, mapper: F) -> MapStr<T, Self, U, F>
where Self: Sized,

Get the input string matched by the parser and map it using a function
Source§

fn try_map<U, F: Fn(T) -> Option<U>>(self, mapper: F) -> TryMap<T, Self, U, F>
where Self: Sized,

Try to map the parsed value using a function
Source§

fn and_then<U, F: Fn(T) -> Result<U, ParsingError>>( self, mapper: F, ) -> AndThen<T, Self, U, F>
where Self: Sized,

Transform and validate the parsed value using the provided function Read more
Source§

fn and_then_or_critical<U, F: Fn(T) -> Result<U, Cow<'static, str>>>( self, mapper: F, ) -> AndThenOrCritical<T, Self, U, F>
where Self: Sized,

Transform and validate the parsed value using the provided function Failures are critical
Source§

fn spanned(self) -> Spanned<T, Self>
where Self: Sized,

Wrap the parsed value in a Spanned
Source§

fn collect<C>(self) -> Map<T, Self, C, fn(T) -> C>
where Self: Sized, T: IntoIterator, C: FromIterator<T::Item>,

Collect the parsed value using the provided iterator type
Source§

fn collect_string(self) -> StringCollected<T, Self>
where Self: Sized,

Collect the input string matched by the parser
Source§

fn atomic_err(self, message: &'static str) -> AtomicErr<T, Self>
where Self: Sized,

Provide an atomic error if the parser fails Read more
Source§

fn critical(self, message: &'static str) -> Critical<T, Self>
where Self: Sized,

Mark the parser as critical Read more
Source§

fn critical_auto_msg(self) -> Critical<T, Self>
where Self: Sized,

Mark the parser as critical Read more
Source§

fn silent(self) -> Silenced<T, Self>
where Self: Sized,

Make the parser silent Read more
Source§

fn padded_by<P, PP: Parser<P>>(self, padding: PP) -> Padded<T, Self, P, PP>
where Self: Sized,

Require the parser to be preceded by and followed by the provided padding Read more
Source§

fn line_padded(self) -> LinePadded<T, Self>
where Self: Sized,

Allow the parser to be surrounded by whitespaces (not newlines)
Source§

fn surrounded_by<L, LP: Parser<L>, R, RP: Parser<R>>( self, left: LP, right: RP, ) -> SurroundedBy<L, LP, T, Self, R, RP>
where Self: Sized,

Require the parser to be preceded by and followed by the provided parsers Read more
Source§

fn separated_by<S, P: Parser<S>>( self, sep: P, ) -> SeparatedBy<T, Self, S, P, NoAllocContainer>
where Self: Sized,

Repeat the parser with the required provided separator between each repetition Read more
Source§

fn separated_by_into_vec<S, P: Parser<S>>( self, sep: P, ) -> SeparatedBy<T, Self, S, P, Vec<T>>
where Self: Sized,

Repeat the parser with the required provided separator between each repetition Read more
Source§

fn separated_by_into_container<C: Container<T>, S, P: Parser<S>>( self, sep: P, ) -> SeparatedBy<T, Self, S, P, C>
where Self: Sized,

Repeat the parser with the required provided separator between each repetition Read more
Source§

fn flatten<U, S>(self) -> Flattened<U, S, T, Self, NoAllocContainer>
where Self: Sized, T: IntoIterator<Item = S>, S: IntoIterator<Item = U>,

Flatten the parser Read more
Source§

fn flatten_into_vec<U, S>(self) -> Flattened<U, S, T, Self, Vec<U>>
where Self: Sized, T: IntoIterator<Item = S>, S: IntoIterator<Item = U>,

Flatten the parser Requires the parser to return a nested iterator. Read more
Source§

fn flatten_into_container<U, S, C: Container<U>>( self, ) -> Flattened<U, S, T, Self, C>
where Self: Sized, T: IntoIterator<Item = S>, S: IntoIterator<Item = U>,

Flatten the parser Requires the parser to return a nested iterator. Read more
Source§

fn to<U: Copy>(self, data: U) -> To<T, Self, U>
where Self: Sized,

Discard the parsed value and replace it with a fixed value
Source§

fn full(self) -> Full<T, Self>
where Self: Sized,

Require the parser to match the entire input
Source§

fn or<P: Parser<T>>(self, other: P) -> Choice<(Self, P), T>
where Self: Sized,

Allow the parser to fallback to another parser in case of failure Read more
Source§

fn validate<F: Fn(&T) -> bool>(self, validator: F) -> Validate<T, Self, F>
where Self: Sized,

Validate the parsed value with a predicate
Source§

fn validate_or_critical<F: Fn(&T) -> bool>( self, validator: F, message: &'static str, ) -> ValidateOrCriticalMsg<T, Self, F>
where Self: Sized,

Validate the parsed value with a predicate or return a provided critical error message Read more
Source§

fn validate_or_dynamic_critical<F: Fn(&T) -> Result<(), Cow<'static, str>>>( self, validator: F, ) -> ValidateOrDynamicCriticalMsg<T, Self, F>
where Self: Sized,

Validate the parsed value with a predicate or return a critical error message Read more
Source§

fn debug<F: for<'a, 'b> Fn(DebugType<'a, 'b, T>)>( self, debugger: F, ) -> Debugging<T, Self, F>
where Self: Sized,

Debug the input and output values of the parser using the provided debugger
Source§

fn erase_type(self) -> Box<dyn Parser<T> + Send + Sync>
where Self: Sized + Send + Sync + 'static,

“Erase” the parser’s type Read more
Source§

fn static_ref(&'static self) -> StaticRef<T, Self>
where Self: Sized,

Wrap a static reference to this parser inside a new parser Read more
Source§

impl<U: Parser<Output>, V: Parser<Output>, W: Parser<Output>, X: Parser<Output>, Y: Parser<Output>, Z: Parser<Output>, Output> Parser<Output> for Choice<(U, V, W, X, Y, Z), Output>

Source§

fn parse_inner(&self, input: &mut ParserInput<'_>) -> ParserResult<Output>

Inner parsing function, to implement
Source§

fn parse(&self, input: &mut ParserInput<'_>) -> ParserResult<T>

Parse an input with the current parser Read more
Source§

fn parse_str(&self, str: &str) -> ParserResult<T>

Parse a string Read more
Source§

fn parse_str_with_file_id(&self, str: &str, file_id: FileId) -> ParserResult<T>

Parse a string as a file Read more
Source§

fn then<U, P: Parser<U>>(self, other: P) -> Then<T, Self, U, P>
where Self: Sized,

Chain this parser with another, getting both parsers’ results combined
Source§

fn then_ignore<U, P: Parser<U>>(self, other: P) -> ThenIgnore<T, Self, U, P>
where Self: Sized,

Chain this parser with another but discard the latter’s parsed value
Source§

fn ignore_then<U, P: Parser<U>>(self, other: P) -> IgnoreThen<T, Self, U, P>
where Self: Sized,

Chain this parser with another but discard the former’s parsed value
Source§

fn followed_by<U, P: Parser<U>>(self, other: P) -> FollowedBy<T, Self, U, P>
where Self: Sized,

Only match if this parser succeeds and the provided parser succeeds as well Read more
Source§

fn not_followed_by<U, P: Parser<U>>( self, other: P, ) -> NotFollowedBy<T, Self, U, P>
where Self: Sized,

Only match if this parser succeeds and the provided parser doesn’t
Source§

fn repeated(self) -> Repeated<T, Self, NoAllocContainer>
where Self: Sized,

Parse as many times as possible, until the parser eventually fails Read more
Source§

fn repeated_into_vec(self) -> Repeated<T, Self, Vec<T>>
where Self: Sized,

Parse as many times as possible, until the parser eventually fails Read more
Source§

fn repeated_into_container<C: Container<T>>(self) -> Repeated<T, Self, C>
where Self: Sized,

Parse as many times as possible, until the parser eventually fails Read more
Source§

fn or_not(self) -> OrNot<T, Self>
where Self: Sized,

Try to parse Read more
Source§

fn map<U, F: Fn(T) -> U>(self, mapper: F) -> Map<T, Self, U, F>
where Self: Sized,

Map the parsed value using a function Read more
Source§

fn map_str<U, F: Fn(&str) -> U>(self, mapper: F) -> MapStr<T, Self, U, F>
where Self: Sized,

Get the input string matched by the parser and map it using a function
Source§

fn try_map<U, F: Fn(T) -> Option<U>>(self, mapper: F) -> TryMap<T, Self, U, F>
where Self: Sized,

Try to map the parsed value using a function
Source§

fn and_then<U, F: Fn(T) -> Result<U, ParsingError>>( self, mapper: F, ) -> AndThen<T, Self, U, F>
where Self: Sized,

Transform and validate the parsed value using the provided function Read more
Source§

fn and_then_or_critical<U, F: Fn(T) -> Result<U, Cow<'static, str>>>( self, mapper: F, ) -> AndThenOrCritical<T, Self, U, F>
where Self: Sized,

Transform and validate the parsed value using the provided function Failures are critical
Source§

fn spanned(self) -> Spanned<T, Self>
where Self: Sized,

Wrap the parsed value in a Spanned
Source§

fn collect<C>(self) -> Map<T, Self, C, fn(T) -> C>
where Self: Sized, T: IntoIterator, C: FromIterator<T::Item>,

Collect the parsed value using the provided iterator type
Source§

fn collect_string(self) -> StringCollected<T, Self>
where Self: Sized,

Collect the input string matched by the parser
Source§

fn atomic_err(self, message: &'static str) -> AtomicErr<T, Self>
where Self: Sized,

Provide an atomic error if the parser fails Read more
Source§

fn critical(self, message: &'static str) -> Critical<T, Self>
where Self: Sized,

Mark the parser as critical Read more
Source§

fn critical_auto_msg(self) -> Critical<T, Self>
where Self: Sized,

Mark the parser as critical Read more
Source§

fn silent(self) -> Silenced<T, Self>
where Self: Sized,

Make the parser silent Read more
Source§

fn padded_by<P, PP: Parser<P>>(self, padding: PP) -> Padded<T, Self, P, PP>
where Self: Sized,

Require the parser to be preceded by and followed by the provided padding Read more
Source§

fn line_padded(self) -> LinePadded<T, Self>
where Self: Sized,

Allow the parser to be surrounded by whitespaces (not newlines)
Source§

fn surrounded_by<L, LP: Parser<L>, R, RP: Parser<R>>( self, left: LP, right: RP, ) -> SurroundedBy<L, LP, T, Self, R, RP>
where Self: Sized,

Require the parser to be preceded by and followed by the provided parsers Read more
Source§

fn separated_by<S, P: Parser<S>>( self, sep: P, ) -> SeparatedBy<T, Self, S, P, NoAllocContainer>
where Self: Sized,

Repeat the parser with the required provided separator between each repetition Read more
Source§

fn separated_by_into_vec<S, P: Parser<S>>( self, sep: P, ) -> SeparatedBy<T, Self, S, P, Vec<T>>
where Self: Sized,

Repeat the parser with the required provided separator between each repetition Read more
Source§

fn separated_by_into_container<C: Container<T>, S, P: Parser<S>>( self, sep: P, ) -> SeparatedBy<T, Self, S, P, C>
where Self: Sized,

Repeat the parser with the required provided separator between each repetition Read more
Source§

fn flatten<U, S>(self) -> Flattened<U, S, T, Self, NoAllocContainer>
where Self: Sized, T: IntoIterator<Item = S>, S: IntoIterator<Item = U>,

Flatten the parser Read more
Source§

fn flatten_into_vec<U, S>(self) -> Flattened<U, S, T, Self, Vec<U>>
where Self: Sized, T: IntoIterator<Item = S>, S: IntoIterator<Item = U>,

Flatten the parser Requires the parser to return a nested iterator. Read more
Source§

fn flatten_into_container<U, S, C: Container<U>>( self, ) -> Flattened<U, S, T, Self, C>
where Self: Sized, T: IntoIterator<Item = S>, S: IntoIterator<Item = U>,

Flatten the parser Requires the parser to return a nested iterator. Read more
Source§

fn to<U: Copy>(self, data: U) -> To<T, Self, U>
where Self: Sized,

Discard the parsed value and replace it with a fixed value
Source§

fn full(self) -> Full<T, Self>
where Self: Sized,

Require the parser to match the entire input
Source§

fn or<P: Parser<T>>(self, other: P) -> Choice<(Self, P), T>
where Self: Sized,

Allow the parser to fallback to another parser in case of failure Read more
Source§

fn validate<F: Fn(&T) -> bool>(self, validator: F) -> Validate<T, Self, F>
where Self: Sized,

Validate the parsed value with a predicate
Source§

fn validate_or_critical<F: Fn(&T) -> bool>( self, validator: F, message: &'static str, ) -> ValidateOrCriticalMsg<T, Self, F>
where Self: Sized,

Validate the parsed value with a predicate or return a provided critical error message Read more
Source§

fn validate_or_dynamic_critical<F: Fn(&T) -> Result<(), Cow<'static, str>>>( self, validator: F, ) -> ValidateOrDynamicCriticalMsg<T, Self, F>
where Self: Sized,

Validate the parsed value with a predicate or return a critical error message Read more
Source§

fn debug<F: for<'a, 'b> Fn(DebugType<'a, 'b, T>)>( self, debugger: F, ) -> Debugging<T, Self, F>
where Self: Sized,

Debug the input and output values of the parser using the provided debugger
Source§

fn erase_type(self) -> Box<dyn Parser<T> + Send + Sync>
where Self: Sized + Send + Sync + 'static,

“Erase” the parser’s type Read more
Source§

fn static_ref(&'static self) -> StaticRef<T, Self>
where Self: Sized,

Wrap a static reference to this parser inside a new parser Read more
Source§

impl<V: Parser<Output>, W: Parser<Output>, X: Parser<Output>, Y: Parser<Output>, Z: Parser<Output>, Output> Parser<Output> for Choice<(V, W, X, Y, Z), Output>

Source§

fn parse_inner(&self, input: &mut ParserInput<'_>) -> ParserResult<Output>

Inner parsing function, to implement
Source§

fn parse(&self, input: &mut ParserInput<'_>) -> ParserResult<T>

Parse an input with the current parser Read more
Source§

fn parse_str(&self, str: &str) -> ParserResult<T>

Parse a string Read more
Source§

fn parse_str_with_file_id(&self, str: &str, file_id: FileId) -> ParserResult<T>

Parse a string as a file Read more
Source§

fn then<U, P: Parser<U>>(self, other: P) -> Then<T, Self, U, P>
where Self: Sized,

Chain this parser with another, getting both parsers’ results combined
Source§

fn then_ignore<U, P: Parser<U>>(self, other: P) -> ThenIgnore<T, Self, U, P>
where Self: Sized,

Chain this parser with another but discard the latter’s parsed value
Source§

fn ignore_then<U, P: Parser<U>>(self, other: P) -> IgnoreThen<T, Self, U, P>
where Self: Sized,

Chain this parser with another but discard the former’s parsed value
Source§

fn followed_by<U, P: Parser<U>>(self, other: P) -> FollowedBy<T, Self, U, P>
where Self: Sized,

Only match if this parser succeeds and the provided parser succeeds as well Read more
Source§

fn not_followed_by<U, P: Parser<U>>( self, other: P, ) -> NotFollowedBy<T, Self, U, P>
where Self: Sized,

Only match if this parser succeeds and the provided parser doesn’t
Source§

fn repeated(self) -> Repeated<T, Self, NoAllocContainer>
where Self: Sized,

Parse as many times as possible, until the parser eventually fails Read more
Source§

fn repeated_into_vec(self) -> Repeated<T, Self, Vec<T>>
where Self: Sized,

Parse as many times as possible, until the parser eventually fails Read more
Source§

fn repeated_into_container<C: Container<T>>(self) -> Repeated<T, Self, C>
where Self: Sized,

Parse as many times as possible, until the parser eventually fails Read more
Source§

fn or_not(self) -> OrNot<T, Self>
where Self: Sized,

Try to parse Read more
Source§

fn map<U, F: Fn(T) -> U>(self, mapper: F) -> Map<T, Self, U, F>
where Self: Sized,

Map the parsed value using a function Read more
Source§

fn map_str<U, F: Fn(&str) -> U>(self, mapper: F) -> MapStr<T, Self, U, F>
where Self: Sized,

Get the input string matched by the parser and map it using a function
Source§

fn try_map<U, F: Fn(T) -> Option<U>>(self, mapper: F) -> TryMap<T, Self, U, F>
where Self: Sized,

Try to map the parsed value using a function
Source§

fn and_then<U, F: Fn(T) -> Result<U, ParsingError>>( self, mapper: F, ) -> AndThen<T, Self, U, F>
where Self: Sized,

Transform and validate the parsed value using the provided function Read more
Source§

fn and_then_or_critical<U, F: Fn(T) -> Result<U, Cow<'static, str>>>( self, mapper: F, ) -> AndThenOrCritical<T, Self, U, F>
where Self: Sized,

Transform and validate the parsed value using the provided function Failures are critical
Source§

fn spanned(self) -> Spanned<T, Self>
where Self: Sized,

Wrap the parsed value in a Spanned
Source§

fn collect<C>(self) -> Map<T, Self, C, fn(T) -> C>
where Self: Sized, T: IntoIterator, C: FromIterator<T::Item>,

Collect the parsed value using the provided iterator type
Source§

fn collect_string(self) -> StringCollected<T, Self>
where Self: Sized,

Collect the input string matched by the parser
Source§

fn atomic_err(self, message: &'static str) -> AtomicErr<T, Self>
where Self: Sized,

Provide an atomic error if the parser fails Read more
Source§

fn critical(self, message: &'static str) -> Critical<T, Self>
where Self: Sized,

Mark the parser as critical Read more
Source§

fn critical_auto_msg(self) -> Critical<T, Self>
where Self: Sized,

Mark the parser as critical Read more
Source§

fn silent(self) -> Silenced<T, Self>
where Self: Sized,

Make the parser silent Read more
Source§

fn padded_by<P, PP: Parser<P>>(self, padding: PP) -> Padded<T, Self, P, PP>
where Self: Sized,

Require the parser to be preceded by and followed by the provided padding Read more
Source§

fn line_padded(self) -> LinePadded<T, Self>
where Self: Sized,

Allow the parser to be surrounded by whitespaces (not newlines)
Source§

fn surrounded_by<L, LP: Parser<L>, R, RP: Parser<R>>( self, left: LP, right: RP, ) -> SurroundedBy<L, LP, T, Self, R, RP>
where Self: Sized,

Require the parser to be preceded by and followed by the provided parsers Read more
Source§

fn separated_by<S, P: Parser<S>>( self, sep: P, ) -> SeparatedBy<T, Self, S, P, NoAllocContainer>
where Self: Sized,

Repeat the parser with the required provided separator between each repetition Read more
Source§

fn separated_by_into_vec<S, P: Parser<S>>( self, sep: P, ) -> SeparatedBy<T, Self, S, P, Vec<T>>
where Self: Sized,

Repeat the parser with the required provided separator between each repetition Read more
Source§

fn separated_by_into_container<C: Container<T>, S, P: Parser<S>>( self, sep: P, ) -> SeparatedBy<T, Self, S, P, C>
where Self: Sized,

Repeat the parser with the required provided separator between each repetition Read more
Source§

fn flatten<U, S>(self) -> Flattened<U, S, T, Self, NoAllocContainer>
where Self: Sized, T: IntoIterator<Item = S>, S: IntoIterator<Item = U>,

Flatten the parser Read more
Source§

fn flatten_into_vec<U, S>(self) -> Flattened<U, S, T, Self, Vec<U>>
where Self: Sized, T: IntoIterator<Item = S>, S: IntoIterator<Item = U>,

Flatten the parser Requires the parser to return a nested iterator. Read more
Source§

fn flatten_into_container<U, S, C: Container<U>>( self, ) -> Flattened<U, S, T, Self, C>
where Self: Sized, T: IntoIterator<Item = S>, S: IntoIterator<Item = U>,

Flatten the parser Requires the parser to return a nested iterator. Read more
Source§

fn to<U: Copy>(self, data: U) -> To<T, Self, U>
where Self: Sized,

Discard the parsed value and replace it with a fixed value
Source§

fn full(self) -> Full<T, Self>
where Self: Sized,

Require the parser to match the entire input
Source§

fn or<P: Parser<T>>(self, other: P) -> Choice<(Self, P), T>
where Self: Sized,

Allow the parser to fallback to another parser in case of failure Read more
Source§

fn validate<F: Fn(&T) -> bool>(self, validator: F) -> Validate<T, Self, F>
where Self: Sized,

Validate the parsed value with a predicate
Source§

fn validate_or_critical<F: Fn(&T) -> bool>( self, validator: F, message: &'static str, ) -> ValidateOrCriticalMsg<T, Self, F>
where Self: Sized,

Validate the parsed value with a predicate or return a provided critical error message Read more
Source§

fn validate_or_dynamic_critical<F: Fn(&T) -> Result<(), Cow<'static, str>>>( self, validator: F, ) -> ValidateOrDynamicCriticalMsg<T, Self, F>
where Self: Sized,

Validate the parsed value with a predicate or return a critical error message Read more
Source§

fn debug<F: for<'a, 'b> Fn(DebugType<'a, 'b, T>)>( self, debugger: F, ) -> Debugging<T, Self, F>
where Self: Sized,

Debug the input and output values of the parser using the provided debugger
Source§

fn erase_type(self) -> Box<dyn Parser<T> + Send + Sync>
where Self: Sized + Send + Sync + 'static,

“Erase” the parser’s type Read more
Source§

fn static_ref(&'static self) -> StaticRef<T, Self>
where Self: Sized,

Wrap a static reference to this parser inside a new parser Read more
Source§

impl<W: Parser<Output>, X: Parser<Output>, Y: Parser<Output>, Z: Parser<Output>, Output> Parser<Output> for Choice<(W, X, Y, Z), Output>

Source§

fn parse_inner(&self, input: &mut ParserInput<'_>) -> ParserResult<Output>

Inner parsing function, to implement
Source§

fn parse(&self, input: &mut ParserInput<'_>) -> ParserResult<T>

Parse an input with the current parser Read more
Source§

fn parse_str(&self, str: &str) -> ParserResult<T>

Parse a string Read more
Source§

fn parse_str_with_file_id(&self, str: &str, file_id: FileId) -> ParserResult<T>

Parse a string as a file Read more
Source§

fn then<U, P: Parser<U>>(self, other: P) -> Then<T, Self, U, P>
where Self: Sized,

Chain this parser with another, getting both parsers’ results combined
Source§

fn then_ignore<U, P: Parser<U>>(self, other: P) -> ThenIgnore<T, Self, U, P>
where Self: Sized,

Chain this parser with another but discard the latter’s parsed value
Source§

fn ignore_then<U, P: Parser<U>>(self, other: P) -> IgnoreThen<T, Self, U, P>
where Self: Sized,

Chain this parser with another but discard the former’s parsed value
Source§

fn followed_by<U, P: Parser<U>>(self, other: P) -> FollowedBy<T, Self, U, P>
where Self: Sized,

Only match if this parser succeeds and the provided parser succeeds as well Read more
Source§

fn not_followed_by<U, P: Parser<U>>( self, other: P, ) -> NotFollowedBy<T, Self, U, P>
where Self: Sized,

Only match if this parser succeeds and the provided parser doesn’t
Source§

fn repeated(self) -> Repeated<T, Self, NoAllocContainer>
where Self: Sized,

Parse as many times as possible, until the parser eventually fails Read more
Source§

fn repeated_into_vec(self) -> Repeated<T, Self, Vec<T>>
where Self: Sized,

Parse as many times as possible, until the parser eventually fails Read more
Source§

fn repeated_into_container<C: Container<T>>(self) -> Repeated<T, Self, C>
where Self: Sized,

Parse as many times as possible, until the parser eventually fails Read more
Source§

fn or_not(self) -> OrNot<T, Self>
where Self: Sized,

Try to parse Read more
Source§

fn map<U, F: Fn(T) -> U>(self, mapper: F) -> Map<T, Self, U, F>
where Self: Sized,

Map the parsed value using a function Read more
Source§

fn map_str<U, F: Fn(&str) -> U>(self, mapper: F) -> MapStr<T, Self, U, F>
where Self: Sized,

Get the input string matched by the parser and map it using a function
Source§

fn try_map<U, F: Fn(T) -> Option<U>>(self, mapper: F) -> TryMap<T, Self, U, F>
where Self: Sized,

Try to map the parsed value using a function
Source§

fn and_then<U, F: Fn(T) -> Result<U, ParsingError>>( self, mapper: F, ) -> AndThen<T, Self, U, F>
where Self: Sized,

Transform and validate the parsed value using the provided function Read more
Source§

fn and_then_or_critical<U, F: Fn(T) -> Result<U, Cow<'static, str>>>( self, mapper: F, ) -> AndThenOrCritical<T, Self, U, F>
where Self: Sized,

Transform and validate the parsed value using the provided function Failures are critical
Source§

fn spanned(self) -> Spanned<T, Self>
where Self: Sized,

Wrap the parsed value in a Spanned
Source§

fn collect<C>(self) -> Map<T, Self, C, fn(T) -> C>
where Self: Sized, T: IntoIterator, C: FromIterator<T::Item>,

Collect the parsed value using the provided iterator type
Source§

fn collect_string(self) -> StringCollected<T, Self>
where Self: Sized,

Collect the input string matched by the parser
Source§

fn atomic_err(self, message: &'static str) -> AtomicErr<T, Self>
where Self: Sized,

Provide an atomic error if the parser fails Read more
Source§

fn critical(self, message: &'static str) -> Critical<T, Self>
where Self: Sized,

Mark the parser as critical Read more
Source§

fn critical_auto_msg(self) -> Critical<T, Self>
where Self: Sized,

Mark the parser as critical Read more
Source§

fn silent(self) -> Silenced<T, Self>
where Self: Sized,

Make the parser silent Read more
Source§

fn padded_by<P, PP: Parser<P>>(self, padding: PP) -> Padded<T, Self, P, PP>
where Self: Sized,

Require the parser to be preceded by and followed by the provided padding Read more
Source§

fn line_padded(self) -> LinePadded<T, Self>
where Self: Sized,

Allow the parser to be surrounded by whitespaces (not newlines)
Source§

fn surrounded_by<L, LP: Parser<L>, R, RP: Parser<R>>( self, left: LP, right: RP, ) -> SurroundedBy<L, LP, T, Self, R, RP>
where Self: Sized,

Require the parser to be preceded by and followed by the provided parsers Read more
Source§

fn separated_by<S, P: Parser<S>>( self, sep: P, ) -> SeparatedBy<T, Self, S, P, NoAllocContainer>
where Self: Sized,

Repeat the parser with the required provided separator between each repetition Read more
Source§

fn separated_by_into_vec<S, P: Parser<S>>( self, sep: P, ) -> SeparatedBy<T, Self, S, P, Vec<T>>
where Self: Sized,

Repeat the parser with the required provided separator between each repetition Read more
Source§

fn separated_by_into_container<C: Container<T>, S, P: Parser<S>>( self, sep: P, ) -> SeparatedBy<T, Self, S, P, C>
where Self: Sized,

Repeat the parser with the required provided separator between each repetition Read more
Source§

fn flatten<U, S>(self) -> Flattened<U, S, T, Self, NoAllocContainer>
where Self: Sized, T: IntoIterator<Item = S>, S: IntoIterator<Item = U>,

Flatten the parser Read more
Source§

fn flatten_into_vec<U, S>(self) -> Flattened<U, S, T, Self, Vec<U>>
where Self: Sized, T: IntoIterator<Item = S>, S: IntoIterator<Item = U>,

Flatten the parser Requires the parser to return a nested iterator. Read more
Source§

fn flatten_into_container<U, S, C: Container<U>>( self, ) -> Flattened<U, S, T, Self, C>
where Self: Sized, T: IntoIterator<Item = S>, S: IntoIterator<Item = U>,

Flatten the parser Requires the parser to return a nested iterator. Read more
Source§

fn to<U: Copy>(self, data: U) -> To<T, Self, U>
where Self: Sized,

Discard the parsed value and replace it with a fixed value
Source§

fn full(self) -> Full<T, Self>
where Self: Sized,

Require the parser to match the entire input
Source§

fn or<P: Parser<T>>(self, other: P) -> Choice<(Self, P), T>
where Self: Sized,

Allow the parser to fallback to another parser in case of failure Read more
Source§

fn validate<F: Fn(&T) -> bool>(self, validator: F) -> Validate<T, Self, F>
where Self: Sized,

Validate the parsed value with a predicate
Source§

fn validate_or_critical<F: Fn(&T) -> bool>( self, validator: F, message: &'static str, ) -> ValidateOrCriticalMsg<T, Self, F>
where Self: Sized,

Validate the parsed value with a predicate or return a provided critical error message Read more
Source§

fn validate_or_dynamic_critical<F: Fn(&T) -> Result<(), Cow<'static, str>>>( self, validator: F, ) -> ValidateOrDynamicCriticalMsg<T, Self, F>
where Self: Sized,

Validate the parsed value with a predicate or return a critical error message Read more
Source§

fn debug<F: for<'a, 'b> Fn(DebugType<'a, 'b, T>)>( self, debugger: F, ) -> Debugging<T, Self, F>
where Self: Sized,

Debug the input and output values of the parser using the provided debugger
Source§

fn erase_type(self) -> Box<dyn Parser<T> + Send + Sync>
where Self: Sized + Send + Sync + 'static,

“Erase” the parser’s type Read more
Source§

fn static_ref(&'static self) -> StaticRef<T, Self>
where Self: Sized,

Wrap a static reference to this parser inside a new parser Read more
Source§

impl<X: Parser<Output>, Y: Parser<Output>, Z: Parser<Output>, Output> Parser<Output> for Choice<(X, Y, Z), Output>

Source§

fn parse_inner(&self, input: &mut ParserInput<'_>) -> ParserResult<Output>

Inner parsing function, to implement
Source§

fn parse(&self, input: &mut ParserInput<'_>) -> ParserResult<T>

Parse an input with the current parser Read more
Source§

fn parse_str(&self, str: &str) -> ParserResult<T>

Parse a string Read more
Source§

fn parse_str_with_file_id(&self, str: &str, file_id: FileId) -> ParserResult<T>

Parse a string as a file Read more
Source§

fn then<U, P: Parser<U>>(self, other: P) -> Then<T, Self, U, P>
where Self: Sized,

Chain this parser with another, getting both parsers’ results combined
Source§

fn then_ignore<U, P: Parser<U>>(self, other: P) -> ThenIgnore<T, Self, U, P>
where Self: Sized,

Chain this parser with another but discard the latter’s parsed value
Source§

fn ignore_then<U, P: Parser<U>>(self, other: P) -> IgnoreThen<T, Self, U, P>
where Self: Sized,

Chain this parser with another but discard the former’s parsed value
Source§

fn followed_by<U, P: Parser<U>>(self, other: P) -> FollowedBy<T, Self, U, P>
where Self: Sized,

Only match if this parser succeeds and the provided parser succeeds as well Read more
Source§

fn not_followed_by<U, P: Parser<U>>( self, other: P, ) -> NotFollowedBy<T, Self, U, P>
where Self: Sized,

Only match if this parser succeeds and the provided parser doesn’t
Source§

fn repeated(self) -> Repeated<T, Self, NoAllocContainer>
where Self: Sized,

Parse as many times as possible, until the parser eventually fails Read more
Source§

fn repeated_into_vec(self) -> Repeated<T, Self, Vec<T>>
where Self: Sized,

Parse as many times as possible, until the parser eventually fails Read more
Source§

fn repeated_into_container<C: Container<T>>(self) -> Repeated<T, Self, C>
where Self: Sized,

Parse as many times as possible, until the parser eventually fails Read more
Source§

fn or_not(self) -> OrNot<T, Self>
where Self: Sized,

Try to parse Read more
Source§

fn map<U, F: Fn(T) -> U>(self, mapper: F) -> Map<T, Self, U, F>
where Self: Sized,

Map the parsed value using a function Read more
Source§

fn map_str<U, F: Fn(&str) -> U>(self, mapper: F) -> MapStr<T, Self, U, F>
where Self: Sized,

Get the input string matched by the parser and map it using a function
Source§

fn try_map<U, F: Fn(T) -> Option<U>>(self, mapper: F) -> TryMap<T, Self, U, F>
where Self: Sized,

Try to map the parsed value using a function
Source§

fn and_then<U, F: Fn(T) -> Result<U, ParsingError>>( self, mapper: F, ) -> AndThen<T, Self, U, F>
where Self: Sized,

Transform and validate the parsed value using the provided function Read more
Source§

fn and_then_or_critical<U, F: Fn(T) -> Result<U, Cow<'static, str>>>( self, mapper: F, ) -> AndThenOrCritical<T, Self, U, F>
where Self: Sized,

Transform and validate the parsed value using the provided function Failures are critical
Source§

fn spanned(self) -> Spanned<T, Self>
where Self: Sized,

Wrap the parsed value in a Spanned
Source§

fn collect<C>(self) -> Map<T, Self, C, fn(T) -> C>
where Self: Sized, T: IntoIterator, C: FromIterator<T::Item>,

Collect the parsed value using the provided iterator type
Source§

fn collect_string(self) -> StringCollected<T, Self>
where Self: Sized,

Collect the input string matched by the parser
Source§

fn atomic_err(self, message: &'static str) -> AtomicErr<T, Self>
where Self: Sized,

Provide an atomic error if the parser fails Read more
Source§

fn critical(self, message: &'static str) -> Critical<T, Self>
where Self: Sized,

Mark the parser as critical Read more
Source§

fn critical_auto_msg(self) -> Critical<T, Self>
where Self: Sized,

Mark the parser as critical Read more
Source§

fn silent(self) -> Silenced<T, Self>
where Self: Sized,

Make the parser silent Read more
Source§

fn padded_by<P, PP: Parser<P>>(self, padding: PP) -> Padded<T, Self, P, PP>
where Self: Sized,

Require the parser to be preceded by and followed by the provided padding Read more
Source§

fn line_padded(self) -> LinePadded<T, Self>
where Self: Sized,

Allow the parser to be surrounded by whitespaces (not newlines)
Source§

fn surrounded_by<L, LP: Parser<L>, R, RP: Parser<R>>( self, left: LP, right: RP, ) -> SurroundedBy<L, LP, T, Self, R, RP>
where Self: Sized,

Require the parser to be preceded by and followed by the provided parsers Read more
Source§

fn separated_by<S, P: Parser<S>>( self, sep: P, ) -> SeparatedBy<T, Self, S, P, NoAllocContainer>
where Self: Sized,

Repeat the parser with the required provided separator between each repetition Read more
Source§

fn separated_by_into_vec<S, P: Parser<S>>( self, sep: P, ) -> SeparatedBy<T, Self, S, P, Vec<T>>
where Self: Sized,

Repeat the parser with the required provided separator between each repetition Read more
Source§

fn separated_by_into_container<C: Container<T>, S, P: Parser<S>>( self, sep: P, ) -> SeparatedBy<T, Self, S, P, C>
where Self: Sized,

Repeat the parser with the required provided separator between each repetition Read more
Source§

fn flatten<U, S>(self) -> Flattened<U, S, T, Self, NoAllocContainer>
where Self: Sized, T: IntoIterator<Item = S>, S: IntoIterator<Item = U>,

Flatten the parser Read more
Source§

fn flatten_into_vec<U, S>(self) -> Flattened<U, S, T, Self, Vec<U>>
where Self: Sized, T: IntoIterator<Item = S>, S: IntoIterator<Item = U>,

Flatten the parser Requires the parser to return a nested iterator. Read more
Source§

fn flatten_into_container<U, S, C: Container<U>>( self, ) -> Flattened<U, S, T, Self, C>
where Self: Sized, T: IntoIterator<Item = S>, S: IntoIterator<Item = U>,

Flatten the parser Requires the parser to return a nested iterator. Read more
Source§

fn to<U: Copy>(self, data: U) -> To<T, Self, U>
where Self: Sized,

Discard the parsed value and replace it with a fixed value
Source§

fn full(self) -> Full<T, Self>
where Self: Sized,

Require the parser to match the entire input
Source§

fn or<P: Parser<T>>(self, other: P) -> Choice<(Self, P), T>
where Self: Sized,

Allow the parser to fallback to another parser in case of failure Read more
Source§

fn validate<F: Fn(&T) -> bool>(self, validator: F) -> Validate<T, Self, F>
where Self: Sized,

Validate the parsed value with a predicate
Source§

fn validate_or_critical<F: Fn(&T) -> bool>( self, validator: F, message: &'static str, ) -> ValidateOrCriticalMsg<T, Self, F>
where Self: Sized,

Validate the parsed value with a predicate or return a provided critical error message Read more
Source§

fn validate_or_dynamic_critical<F: Fn(&T) -> Result<(), Cow<'static, str>>>( self, validator: F, ) -> ValidateOrDynamicCriticalMsg<T, Self, F>
where Self: Sized,

Validate the parsed value with a predicate or return a critical error message Read more
Source§

fn debug<F: for<'a, 'b> Fn(DebugType<'a, 'b, T>)>( self, debugger: F, ) -> Debugging<T, Self, F>
where Self: Sized,

Debug the input and output values of the parser using the provided debugger
Source§

fn erase_type(self) -> Box<dyn Parser<T> + Send + Sync>
where Self: Sized + Send + Sync + 'static,

“Erase” the parser’s type Read more
Source§

fn static_ref(&'static self) -> StaticRef<T, Self>
where Self: Sized,

Wrap a static reference to this parser inside a new parser Read more
Source§

impl<Y: Parser<Output>, Z: Parser<Output>, Output> Parser<Output> for Choice<(Y, Z), Output>

Source§

fn parse_inner(&self, input: &mut ParserInput<'_>) -> ParserResult<Output>

Inner parsing function, to implement
Source§

fn parse(&self, input: &mut ParserInput<'_>) -> ParserResult<T>

Parse an input with the current parser Read more
Source§

fn parse_str(&self, str: &str) -> ParserResult<T>

Parse a string Read more
Source§

fn parse_str_with_file_id(&self, str: &str, file_id: FileId) -> ParserResult<T>

Parse a string as a file Read more
Source§

fn then<U, P: Parser<U>>(self, other: P) -> Then<T, Self, U, P>
where Self: Sized,

Chain this parser with another, getting both parsers’ results combined
Source§

fn then_ignore<U, P: Parser<U>>(self, other: P) -> ThenIgnore<T, Self, U, P>
where Self: Sized,

Chain this parser with another but discard the latter’s parsed value
Source§

fn ignore_then<U, P: Parser<U>>(self, other: P) -> IgnoreThen<T, Self, U, P>
where Self: Sized,

Chain this parser with another but discard the former’s parsed value
Source§

fn followed_by<U, P: Parser<U>>(self, other: P) -> FollowedBy<T, Self, U, P>
where Self: Sized,

Only match if this parser succeeds and the provided parser succeeds as well Read more
Source§

fn not_followed_by<U, P: Parser<U>>( self, other: P, ) -> NotFollowedBy<T, Self, U, P>
where Self: Sized,

Only match if this parser succeeds and the provided parser doesn’t
Source§

fn repeated(self) -> Repeated<T, Self, NoAllocContainer>
where Self: Sized,

Parse as many times as possible, until the parser eventually fails Read more
Source§

fn repeated_into_vec(self) -> Repeated<T, Self, Vec<T>>
where Self: Sized,

Parse as many times as possible, until the parser eventually fails Read more
Source§

fn repeated_into_container<C: Container<T>>(self) -> Repeated<T, Self, C>
where Self: Sized,

Parse as many times as possible, until the parser eventually fails Read more
Source§

fn or_not(self) -> OrNot<T, Self>
where Self: Sized,

Try to parse Read more
Source§

fn map<U, F: Fn(T) -> U>(self, mapper: F) -> Map<T, Self, U, F>
where Self: Sized,

Map the parsed value using a function Read more
Source§

fn map_str<U, F: Fn(&str) -> U>(self, mapper: F) -> MapStr<T, Self, U, F>
where Self: Sized,

Get the input string matched by the parser and map it using a function
Source§

fn try_map<U, F: Fn(T) -> Option<U>>(self, mapper: F) -> TryMap<T, Self, U, F>
where Self: Sized,

Try to map the parsed value using a function
Source§

fn and_then<U, F: Fn(T) -> Result<U, ParsingError>>( self, mapper: F, ) -> AndThen<T, Self, U, F>
where Self: Sized,

Transform and validate the parsed value using the provided function Read more
Source§

fn and_then_or_critical<U, F: Fn(T) -> Result<U, Cow<'static, str>>>( self, mapper: F, ) -> AndThenOrCritical<T, Self, U, F>
where Self: Sized,

Transform and validate the parsed value using the provided function Failures are critical
Source§

fn spanned(self) -> Spanned<T, Self>
where Self: Sized,

Wrap the parsed value in a Spanned
Source§

fn collect<C>(self) -> Map<T, Self, C, fn(T) -> C>
where Self: Sized, T: IntoIterator, C: FromIterator<T::Item>,

Collect the parsed value using the provided iterator type
Source§

fn collect_string(self) -> StringCollected<T, Self>
where Self: Sized,

Collect the input string matched by the parser
Source§

fn atomic_err(self, message: &'static str) -> AtomicErr<T, Self>
where Self: Sized,

Provide an atomic error if the parser fails Read more
Source§

fn critical(self, message: &'static str) -> Critical<T, Self>
where Self: Sized,

Mark the parser as critical Read more
Source§

fn critical_auto_msg(self) -> Critical<T, Self>
where Self: Sized,

Mark the parser as critical Read more
Source§

fn silent(self) -> Silenced<T, Self>
where Self: Sized,

Make the parser silent Read more
Source§

fn padded_by<P, PP: Parser<P>>(self, padding: PP) -> Padded<T, Self, P, PP>
where Self: Sized,

Require the parser to be preceded by and followed by the provided padding Read more
Source§

fn line_padded(self) -> LinePadded<T, Self>
where Self: Sized,

Allow the parser to be surrounded by whitespaces (not newlines)
Source§

fn surrounded_by<L, LP: Parser<L>, R, RP: Parser<R>>( self, left: LP, right: RP, ) -> SurroundedBy<L, LP, T, Self, R, RP>
where Self: Sized,

Require the parser to be preceded by and followed by the provided parsers Read more
Source§

fn separated_by<S, P: Parser<S>>( self, sep: P, ) -> SeparatedBy<T, Self, S, P, NoAllocContainer>
where Self: Sized,

Repeat the parser with the required provided separator between each repetition Read more
Source§

fn separated_by_into_vec<S, P: Parser<S>>( self, sep: P, ) -> SeparatedBy<T, Self, S, P, Vec<T>>
where Self: Sized,

Repeat the parser with the required provided separator between each repetition Read more
Source§

fn separated_by_into_container<C: Container<T>, S, P: Parser<S>>( self, sep: P, ) -> SeparatedBy<T, Self, S, P, C>
where Self: Sized,

Repeat the parser with the required provided separator between each repetition Read more
Source§

fn flatten<U, S>(self) -> Flattened<U, S, T, Self, NoAllocContainer>
where Self: Sized, T: IntoIterator<Item = S>, S: IntoIterator<Item = U>,

Flatten the parser Read more
Source§

fn flatten_into_vec<U, S>(self) -> Flattened<U, S, T, Self, Vec<U>>
where Self: Sized, T: IntoIterator<Item = S>, S: IntoIterator<Item = U>,

Flatten the parser Requires the parser to return a nested iterator. Read more
Source§

fn flatten_into_container<U, S, C: Container<U>>( self, ) -> Flattened<U, S, T, Self, C>
where Self: Sized, T: IntoIterator<Item = S>, S: IntoIterator<Item = U>,

Flatten the parser Requires the parser to return a nested iterator. Read more
Source§

fn to<U: Copy>(self, data: U) -> To<T, Self, U>
where Self: Sized,

Discard the parsed value and replace it with a fixed value
Source§

fn full(self) -> Full<T, Self>
where Self: Sized,

Require the parser to match the entire input
Source§

fn or<P: Parser<T>>(self, other: P) -> Choice<(Self, P), T>
where Self: Sized,

Allow the parser to fallback to another parser in case of failure Read more
Source§

fn validate<F: Fn(&T) -> bool>(self, validator: F) -> Validate<T, Self, F>
where Self: Sized,

Validate the parsed value with a predicate
Source§

fn validate_or_critical<F: Fn(&T) -> bool>( self, validator: F, message: &'static str, ) -> ValidateOrCriticalMsg<T, Self, F>
where Self: Sized,

Validate the parsed value with a predicate or return a provided critical error message Read more
Source§

fn validate_or_dynamic_critical<F: Fn(&T) -> Result<(), Cow<'static, str>>>( self, validator: F, ) -> ValidateOrDynamicCriticalMsg<T, Self, F>
where Self: Sized,

Validate the parsed value with a predicate or return a critical error message Read more
Source§

fn debug<F: for<'a, 'b> Fn(DebugType<'a, 'b, T>)>( self, debugger: F, ) -> Debugging<T, Self, F>
where Self: Sized,

Debug the input and output values of the parser using the provided debugger
Source§

fn erase_type(self) -> Box<dyn Parser<T> + Send + Sync>
where Self: Sized + Send + Sync + 'static,

“Erase” the parser’s type Read more
Source§

fn static_ref(&'static self) -> StaticRef<T, Self>
where Self: Sized,

Wrap a static reference to this parser inside a new parser Read more
Source§

impl<Z: Parser<Output>, Output> Parser<Output> for Choice<(Z,), Output>

Source§

fn parse_inner(&self, input: &mut ParserInput<'_>) -> ParserResult<Output>

Inner parsing function, to implement
Source§

fn parse(&self, input: &mut ParserInput<'_>) -> ParserResult<T>

Parse an input with the current parser Read more
Source§

fn parse_str(&self, str: &str) -> ParserResult<T>

Parse a string Read more
Source§

fn parse_str_with_file_id(&self, str: &str, file_id: FileId) -> ParserResult<T>

Parse a string as a file Read more
Source§

fn then<U, P: Parser<U>>(self, other: P) -> Then<T, Self, U, P>
where Self: Sized,

Chain this parser with another, getting both parsers’ results combined
Source§

fn then_ignore<U, P: Parser<U>>(self, other: P) -> ThenIgnore<T, Self, U, P>
where Self: Sized,

Chain this parser with another but discard the latter’s parsed value
Source§

fn ignore_then<U, P: Parser<U>>(self, other: P) -> IgnoreThen<T, Self, U, P>
where Self: Sized,

Chain this parser with another but discard the former’s parsed value
Source§

fn followed_by<U, P: Parser<U>>(self, other: P) -> FollowedBy<T, Self, U, P>
where Self: Sized,

Only match if this parser succeeds and the provided parser succeeds as well Read more
Source§

fn not_followed_by<U, P: Parser<U>>( self, other: P, ) -> NotFollowedBy<T, Self, U, P>
where Self: Sized,

Only match if this parser succeeds and the provided parser doesn’t
Source§

fn repeated(self) -> Repeated<T, Self, NoAllocContainer>
where Self: Sized,

Parse as many times as possible, until the parser eventually fails Read more
Source§

fn repeated_into_vec(self) -> Repeated<T, Self, Vec<T>>
where Self: Sized,

Parse as many times as possible, until the parser eventually fails Read more
Source§

fn repeated_into_container<C: Container<T>>(self) -> Repeated<T, Self, C>
where Self: Sized,

Parse as many times as possible, until the parser eventually fails Read more
Source§

fn or_not(self) -> OrNot<T, Self>
where Self: Sized,

Try to parse Read more
Source§

fn map<U, F: Fn(T) -> U>(self, mapper: F) -> Map<T, Self, U, F>
where Self: Sized,

Map the parsed value using a function Read more
Source§

fn map_str<U, F: Fn(&str) -> U>(self, mapper: F) -> MapStr<T, Self, U, F>
where Self: Sized,

Get the input string matched by the parser and map it using a function
Source§

fn try_map<U, F: Fn(T) -> Option<U>>(self, mapper: F) -> TryMap<T, Self, U, F>
where Self: Sized,

Try to map the parsed value using a function
Source§

fn and_then<U, F: Fn(T) -> Result<U, ParsingError>>( self, mapper: F, ) -> AndThen<T, Self, U, F>
where Self: Sized,

Transform and validate the parsed value using the provided function Read more
Source§

fn and_then_or_critical<U, F: Fn(T) -> Result<U, Cow<'static, str>>>( self, mapper: F, ) -> AndThenOrCritical<T, Self, U, F>
where Self: Sized,

Transform and validate the parsed value using the provided function Failures are critical
Source§

fn spanned(self) -> Spanned<T, Self>
where Self: Sized,

Wrap the parsed value in a Spanned
Source§

fn collect<C>(self) -> Map<T, Self, C, fn(T) -> C>
where Self: Sized, T: IntoIterator, C: FromIterator<T::Item>,

Collect the parsed value using the provided iterator type
Source§

fn collect_string(self) -> StringCollected<T, Self>
where Self: Sized,

Collect the input string matched by the parser
Source§

fn atomic_err(self, message: &'static str) -> AtomicErr<T, Self>
where Self: Sized,

Provide an atomic error if the parser fails Read more
Source§

fn critical(self, message: &'static str) -> Critical<T, Self>
where Self: Sized,

Mark the parser as critical Read more
Source§

fn critical_auto_msg(self) -> Critical<T, Self>
where Self: Sized,

Mark the parser as critical Read more
Source§

fn silent(self) -> Silenced<T, Self>
where Self: Sized,

Make the parser silent Read more
Source§

fn padded_by<P, PP: Parser<P>>(self, padding: PP) -> Padded<T, Self, P, PP>
where Self: Sized,

Require the parser to be preceded by and followed by the provided padding Read more
Source§

fn line_padded(self) -> LinePadded<T, Self>
where Self: Sized,

Allow the parser to be surrounded by whitespaces (not newlines)
Source§

fn surrounded_by<L, LP: Parser<L>, R, RP: Parser<R>>( self, left: LP, right: RP, ) -> SurroundedBy<L, LP, T, Self, R, RP>
where Self: Sized,

Require the parser to be preceded by and followed by the provided parsers Read more
Source§

fn separated_by<S, P: Parser<S>>( self, sep: P, ) -> SeparatedBy<T, Self, S, P, NoAllocContainer>
where Self: Sized,

Repeat the parser with the required provided separator between each repetition Read more
Source§

fn separated_by_into_vec<S, P: Parser<S>>( self, sep: P, ) -> SeparatedBy<T, Self, S, P, Vec<T>>
where Self: Sized,

Repeat the parser with the required provided separator between each repetition Read more
Source§

fn separated_by_into_container<C: Container<T>, S, P: Parser<S>>( self, sep: P, ) -> SeparatedBy<T, Self, S, P, C>
where Self: Sized,

Repeat the parser with the required provided separator between each repetition Read more
Source§

fn flatten<U, S>(self) -> Flattened<U, S, T, Self, NoAllocContainer>
where Self: Sized, T: IntoIterator<Item = S>, S: IntoIterator<Item = U>,

Flatten the parser Read more
Source§

fn flatten_into_vec<U, S>(self) -> Flattened<U, S, T, Self, Vec<U>>
where Self: Sized, T: IntoIterator<Item = S>, S: IntoIterator<Item = U>,

Flatten the parser Requires the parser to return a nested iterator. Read more
Source§

fn flatten_into_container<U, S, C: Container<U>>( self, ) -> Flattened<U, S, T, Self, C>
where Self: Sized, T: IntoIterator<Item = S>, S: IntoIterator<Item = U>,

Flatten the parser Requires the parser to return a nested iterator. Read more
Source§

fn to<U: Copy>(self, data: U) -> To<T, Self, U>
where Self: Sized,

Discard the parsed value and replace it with a fixed value
Source§

fn full(self) -> Full<T, Self>
where Self: Sized,

Require the parser to match the entire input
Source§

fn or<P: Parser<T>>(self, other: P) -> Choice<(Self, P), T>
where Self: Sized,

Allow the parser to fallback to another parser in case of failure Read more
Source§

fn validate<F: Fn(&T) -> bool>(self, validator: F) -> Validate<T, Self, F>
where Self: Sized,

Validate the parsed value with a predicate
Source§

fn validate_or_critical<F: Fn(&T) -> bool>( self, validator: F, message: &'static str, ) -> ValidateOrCriticalMsg<T, Self, F>
where Self: Sized,

Validate the parsed value with a predicate or return a provided critical error message Read more
Source§

fn validate_or_dynamic_critical<F: Fn(&T) -> Result<(), Cow<'static, str>>>( self, validator: F, ) -> ValidateOrDynamicCriticalMsg<T, Self, F>
where Self: Sized,

Validate the parsed value with a predicate or return a critical error message Read more
Source§

fn debug<F: for<'a, 'b> Fn(DebugType<'a, 'b, T>)>( self, debugger: F, ) -> Debugging<T, Self, F>
where Self: Sized,

Debug the input and output values of the parser using the provided debugger
Source§

fn erase_type(self) -> Box<dyn Parser<T> + Send + Sync>
where Self: Sized + Send + Sync + 'static,

“Erase” the parser’s type Read more
Source§

fn static_ref(&'static self) -> StaticRef<T, Self>
where Self: Sized,

Wrap a static reference to this parser inside a new parser Read more
Source§

impl<T, O> Copy for Choice<T, O>
where T: Copy + IntoChoice<O>, PhantomData<O>: Copy,

Auto Trait Implementations§

§

impl<T, O> Freeze for Choice<T, O>
where T: Freeze,

§

impl<T, O> RefUnwindSafe for Choice<T, O>

§

impl<T, O> Send for Choice<T, O>
where T: Send, O: Send,

§

impl<T, O> Sync for Choice<T, O>
where T: Sync, O: Sync,

§

impl<T, O> Unpin for Choice<T, O>
where T: Unpin, O: Unpin,

§

impl<T, O> UnwindSafe for Choice<T, O>
where T: UnwindSafe, O: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.