pub struct Choice<T: IntoChoice<O>, O> { /* private fields */ }
Implementations§
Trait Implementations§
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>
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>
fn parse_inner(&self, input: &mut ParserInput<'_>) -> ParserResult<Output>
Inner parsing function, to implement
Source§fn parse(&self, input: &mut ParserInput<'_>) -> ParserResult<T>
fn parse(&self, input: &mut ParserInput<'_>) -> ParserResult<T>
Parse an input with the current parser Read more
Source§fn parse_str_with_file_id(&self, str: &str, file_id: FileId) -> ParserResult<T>
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,
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,
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,
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,
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,
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,
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,
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,
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 map<U, F: Fn(T) -> U>(self, mapper: F) -> Map<T, Self, U, F>where
Self: Sized,
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,
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,
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,
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,
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 collect<C>(self) -> Map<T, Self, C, fn(T) -> C>
fn collect<C>(self) -> Map<T, Self, C, fn(T) -> C>
Collect the parsed value using the provided iterator type
Source§fn collect_string(self) -> StringCollected<T, Self>where
Self: Sized,
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,
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,
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,
fn critical_auto_msg(self) -> Critical<T, Self>where
Self: Sized,
Mark the parser as critical Read more
Source§fn padded_by<P, PP: Parser<P>>(self, padding: PP) -> Padded<T, Self, P, PP>where
Self: Sized,
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,
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,
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,
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,
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,
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>
fn flatten<U, S>(self) -> Flattened<U, S, T, Self, NoAllocContainer>
Flatten the parser Read more
Source§fn flatten_into_vec<U, S>(self) -> Flattened<U, S, T, Self, Vec<U>>
fn flatten_into_vec<U, S>(self) -> Flattened<U, S, T, Self, Vec<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>
fn flatten_into_container<U, S, C: Container<U>>( self, ) -> Flattened<U, S, T, Self, C>
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,
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 or<P: Parser<T>>(self, other: P) -> Choice<(Self, P), T>where
Self: Sized,
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,
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,
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,
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,
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§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>
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>
fn parse_inner(&self, input: &mut ParserInput<'_>) -> ParserResult<Output>
Inner parsing function, to implement
Source§fn parse(&self, input: &mut ParserInput<'_>) -> ParserResult<T>
fn parse(&self, input: &mut ParserInput<'_>) -> ParserResult<T>
Parse an input with the current parser Read more
Source§fn parse_str_with_file_id(&self, str: &str, file_id: FileId) -> ParserResult<T>
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,
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,
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,
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,
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,
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,
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,
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,
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 map<U, F: Fn(T) -> U>(self, mapper: F) -> Map<T, Self, U, F>where
Self: Sized,
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,
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,
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,
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,
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 collect<C>(self) -> Map<T, Self, C, fn(T) -> C>
fn collect<C>(self) -> Map<T, Self, C, fn(T) -> C>
Collect the parsed value using the provided iterator type
Source§fn collect_string(self) -> StringCollected<T, Self>where
Self: Sized,
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,
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,
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,
fn critical_auto_msg(self) -> Critical<T, Self>where
Self: Sized,
Mark the parser as critical Read more
Source§fn padded_by<P, PP: Parser<P>>(self, padding: PP) -> Padded<T, Self, P, PP>where
Self: Sized,
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,
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,
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,
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,
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,
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>
fn flatten<U, S>(self) -> Flattened<U, S, T, Self, NoAllocContainer>
Flatten the parser Read more
Source§fn flatten_into_vec<U, S>(self) -> Flattened<U, S, T, Self, Vec<U>>
fn flatten_into_vec<U, S>(self) -> Flattened<U, S, T, Self, Vec<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>
fn flatten_into_container<U, S, C: Container<U>>( self, ) -> Flattened<U, S, T, Self, C>
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,
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 or<P: Parser<T>>(self, other: P) -> Choice<(Self, P), T>where
Self: Sized,
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,
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,
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,
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,
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§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>
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>
fn parse_inner(&self, input: &mut ParserInput<'_>) -> ParserResult<Output>
Inner parsing function, to implement
Source§fn parse(&self, input: &mut ParserInput<'_>) -> ParserResult<T>
fn parse(&self, input: &mut ParserInput<'_>) -> ParserResult<T>
Parse an input with the current parser Read more
Source§fn parse_str_with_file_id(&self, str: &str, file_id: FileId) -> ParserResult<T>
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,
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,
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,
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,
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,
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,
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,
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,
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 map<U, F: Fn(T) -> U>(self, mapper: F) -> Map<T, Self, U, F>where
Self: Sized,
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,
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,
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,
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,
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 collect<C>(self) -> Map<T, Self, C, fn(T) -> C>
fn collect<C>(self) -> Map<T, Self, C, fn(T) -> C>
Collect the parsed value using the provided iterator type
Source§fn collect_string(self) -> StringCollected<T, Self>where
Self: Sized,
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,
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,
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,
fn critical_auto_msg(self) -> Critical<T, Self>where
Self: Sized,
Mark the parser as critical Read more
Source§fn padded_by<P, PP: Parser<P>>(self, padding: PP) -> Padded<T, Self, P, PP>where
Self: Sized,
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,
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,
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,
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,
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,
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>
fn flatten<U, S>(self) -> Flattened<U, S, T, Self, NoAllocContainer>
Flatten the parser Read more
Source§fn flatten_into_vec<U, S>(self) -> Flattened<U, S, T, Self, Vec<U>>
fn flatten_into_vec<U, S>(self) -> Flattened<U, S, T, Self, Vec<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>
fn flatten_into_container<U, S, C: Container<U>>( self, ) -> Flattened<U, S, T, Self, C>
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,
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 or<P: Parser<T>>(self, other: P) -> Choice<(Self, P), T>where
Self: Sized,
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,
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,
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,
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,
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§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>
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>
fn parse_inner(&self, input: &mut ParserInput<'_>) -> ParserResult<Output>
Inner parsing function, to implement
Source§fn parse(&self, input: &mut ParserInput<'_>) -> ParserResult<T>
fn parse(&self, input: &mut ParserInput<'_>) -> ParserResult<T>
Parse an input with the current parser Read more
Source§fn parse_str_with_file_id(&self, str: &str, file_id: FileId) -> ParserResult<T>
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,
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,
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,
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,
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,
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,
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,
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,
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 map<U, F: Fn(T) -> U>(self, mapper: F) -> Map<T, Self, U, F>where
Self: Sized,
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,
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,
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,
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,
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 collect<C>(self) -> Map<T, Self, C, fn(T) -> C>
fn collect<C>(self) -> Map<T, Self, C, fn(T) -> C>
Collect the parsed value using the provided iterator type
Source§fn collect_string(self) -> StringCollected<T, Self>where
Self: Sized,
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,
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,
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,
fn critical_auto_msg(self) -> Critical<T, Self>where
Self: Sized,
Mark the parser as critical Read more
Source§fn padded_by<P, PP: Parser<P>>(self, padding: PP) -> Padded<T, Self, P, PP>where
Self: Sized,
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,
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,
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,
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,
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,
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>
fn flatten<U, S>(self) -> Flattened<U, S, T, Self, NoAllocContainer>
Flatten the parser Read more
Source§fn flatten_into_vec<U, S>(self) -> Flattened<U, S, T, Self, Vec<U>>
fn flatten_into_vec<U, S>(self) -> Flattened<U, S, T, Self, Vec<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>
fn flatten_into_container<U, S, C: Container<U>>( self, ) -> Flattened<U, S, T, Self, C>
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,
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 or<P: Parser<T>>(self, other: P) -> Choice<(Self, P), T>where
Self: Sized,
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,
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,
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,
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,
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§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>
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>
fn parse_inner(&self, input: &mut ParserInput<'_>) -> ParserResult<Output>
Inner parsing function, to implement
Source§fn parse(&self, input: &mut ParserInput<'_>) -> ParserResult<T>
fn parse(&self, input: &mut ParserInput<'_>) -> ParserResult<T>
Parse an input with the current parser Read more
Source§fn parse_str_with_file_id(&self, str: &str, file_id: FileId) -> ParserResult<T>
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,
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,
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,
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,
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,
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,
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,
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,
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 map<U, F: Fn(T) -> U>(self, mapper: F) -> Map<T, Self, U, F>where
Self: Sized,
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,
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,
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,
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,
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 collect<C>(self) -> Map<T, Self, C, fn(T) -> C>
fn collect<C>(self) -> Map<T, Self, C, fn(T) -> C>
Collect the parsed value using the provided iterator type
Source§fn collect_string(self) -> StringCollected<T, Self>where
Self: Sized,
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,
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,
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,
fn critical_auto_msg(self) -> Critical<T, Self>where
Self: Sized,
Mark the parser as critical Read more
Source§fn padded_by<P, PP: Parser<P>>(self, padding: PP) -> Padded<T, Self, P, PP>where
Self: Sized,
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,
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,
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,
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,
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,
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>
fn flatten<U, S>(self) -> Flattened<U, S, T, Self, NoAllocContainer>
Flatten the parser Read more
Source§fn flatten_into_vec<U, S>(self) -> Flattened<U, S, T, Self, Vec<U>>
fn flatten_into_vec<U, S>(self) -> Flattened<U, S, T, Self, Vec<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>
fn flatten_into_container<U, S, C: Container<U>>( self, ) -> Flattened<U, S, T, Self, C>
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,
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 or<P: Parser<T>>(self, other: P) -> Choice<(Self, P), T>where
Self: Sized,
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,
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,
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,
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,
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§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>
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>
fn parse_inner(&self, input: &mut ParserInput<'_>) -> ParserResult<Output>
Inner parsing function, to implement
Source§fn parse(&self, input: &mut ParserInput<'_>) -> ParserResult<T>
fn parse(&self, input: &mut ParserInput<'_>) -> ParserResult<T>
Parse an input with the current parser Read more
Source§fn parse_str_with_file_id(&self, str: &str, file_id: FileId) -> ParserResult<T>
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,
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,
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,
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,
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,
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,
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,
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,
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 map<U, F: Fn(T) -> U>(self, mapper: F) -> Map<T, Self, U, F>where
Self: Sized,
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,
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,
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,
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,
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 collect<C>(self) -> Map<T, Self, C, fn(T) -> C>
fn collect<C>(self) -> Map<T, Self, C, fn(T) -> C>
Collect the parsed value using the provided iterator type
Source§fn collect_string(self) -> StringCollected<T, Self>where
Self: Sized,
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,
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,
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,
fn critical_auto_msg(self) -> Critical<T, Self>where
Self: Sized,
Mark the parser as critical Read more
Source§fn padded_by<P, PP: Parser<P>>(self, padding: PP) -> Padded<T, Self, P, PP>where
Self: Sized,
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,
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,
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,
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,
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,
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>
fn flatten<U, S>(self) -> Flattened<U, S, T, Self, NoAllocContainer>
Flatten the parser Read more
Source§fn flatten_into_vec<U, S>(self) -> Flattened<U, S, T, Self, Vec<U>>
fn flatten_into_vec<U, S>(self) -> Flattened<U, S, T, Self, Vec<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>
fn flatten_into_container<U, S, C: Container<U>>( self, ) -> Flattened<U, S, T, Self, C>
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,
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 or<P: Parser<T>>(self, other: P) -> Choice<(Self, P), T>where
Self: Sized,
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,
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,
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,
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,
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§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>
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>
fn parse_inner(&self, input: &mut ParserInput<'_>) -> ParserResult<Output>
Inner parsing function, to implement
Source§fn parse(&self, input: &mut ParserInput<'_>) -> ParserResult<T>
fn parse(&self, input: &mut ParserInput<'_>) -> ParserResult<T>
Parse an input with the current parser Read more
Source§fn parse_str_with_file_id(&self, str: &str, file_id: FileId) -> ParserResult<T>
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,
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,
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,
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,
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,
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,
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,
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,
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 map<U, F: Fn(T) -> U>(self, mapper: F) -> Map<T, Self, U, F>where
Self: Sized,
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,
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,
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,
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,
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 collect<C>(self) -> Map<T, Self, C, fn(T) -> C>
fn collect<C>(self) -> Map<T, Self, C, fn(T) -> C>
Collect the parsed value using the provided iterator type
Source§fn collect_string(self) -> StringCollected<T, Self>where
Self: Sized,
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,
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,
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,
fn critical_auto_msg(self) -> Critical<T, Self>where
Self: Sized,
Mark the parser as critical Read more
Source§fn padded_by<P, PP: Parser<P>>(self, padding: PP) -> Padded<T, Self, P, PP>where
Self: Sized,
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,
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,
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,
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,
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,
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>
fn flatten<U, S>(self) -> Flattened<U, S, T, Self, NoAllocContainer>
Flatten the parser Read more
Source§fn flatten_into_vec<U, S>(self) -> Flattened<U, S, T, Self, Vec<U>>
fn flatten_into_vec<U, S>(self) -> Flattened<U, S, T, Self, Vec<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>
fn flatten_into_container<U, S, C: Container<U>>( self, ) -> Flattened<U, S, T, Self, C>
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,
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 or<P: Parser<T>>(self, other: P) -> Choice<(Self, P), T>where
Self: Sized,
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,
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,
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,
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,
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§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>
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>
fn parse_inner(&self, input: &mut ParserInput<'_>) -> ParserResult<Output>
Inner parsing function, to implement
Source§fn parse(&self, input: &mut ParserInput<'_>) -> ParserResult<T>
fn parse(&self, input: &mut ParserInput<'_>) -> ParserResult<T>
Parse an input with the current parser Read more
Source§fn parse_str_with_file_id(&self, str: &str, file_id: FileId) -> ParserResult<T>
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,
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,
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,
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,
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,
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,
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,
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,
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 map<U, F: Fn(T) -> U>(self, mapper: F) -> Map<T, Self, U, F>where
Self: Sized,
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,
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,
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,
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,
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 collect<C>(self) -> Map<T, Self, C, fn(T) -> C>
fn collect<C>(self) -> Map<T, Self, C, fn(T) -> C>
Collect the parsed value using the provided iterator type
Source§fn collect_string(self) -> StringCollected<T, Self>where
Self: Sized,
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,
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,
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,
fn critical_auto_msg(self) -> Critical<T, Self>where
Self: Sized,
Mark the parser as critical Read more
Source§fn padded_by<P, PP: Parser<P>>(self, padding: PP) -> Padded<T, Self, P, PP>where
Self: Sized,
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,
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,
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,
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,
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,
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>
fn flatten<U, S>(self) -> Flattened<U, S, T, Self, NoAllocContainer>
Flatten the parser Read more
Source§fn flatten_into_vec<U, S>(self) -> Flattened<U, S, T, Self, Vec<U>>
fn flatten_into_vec<U, S>(self) -> Flattened<U, S, T, Self, Vec<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>
fn flatten_into_container<U, S, C: Container<U>>( self, ) -> Flattened<U, S, T, Self, C>
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,
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 or<P: Parser<T>>(self, other: P) -> Choice<(Self, P), T>where
Self: Sized,
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,
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,
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,
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,
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§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>
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>
fn parse_inner(&self, input: &mut ParserInput<'_>) -> ParserResult<Output>
Inner parsing function, to implement
Source§fn parse(&self, input: &mut ParserInput<'_>) -> ParserResult<T>
fn parse(&self, input: &mut ParserInput<'_>) -> ParserResult<T>
Parse an input with the current parser Read more
Source§fn parse_str_with_file_id(&self, str: &str, file_id: FileId) -> ParserResult<T>
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,
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,
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,
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,
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,
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,
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,
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,
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 map<U, F: Fn(T) -> U>(self, mapper: F) -> Map<T, Self, U, F>where
Self: Sized,
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,
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,
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,
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,
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 collect<C>(self) -> Map<T, Self, C, fn(T) -> C>
fn collect<C>(self) -> Map<T, Self, C, fn(T) -> C>
Collect the parsed value using the provided iterator type
Source§fn collect_string(self) -> StringCollected<T, Self>where
Self: Sized,
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,
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,
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,
fn critical_auto_msg(self) -> Critical<T, Self>where
Self: Sized,
Mark the parser as critical Read more
Source§fn padded_by<P, PP: Parser<P>>(self, padding: PP) -> Padded<T, Self, P, PP>where
Self: Sized,
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,
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,
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,
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,
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,
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>
fn flatten<U, S>(self) -> Flattened<U, S, T, Self, NoAllocContainer>
Flatten the parser Read more
Source§fn flatten_into_vec<U, S>(self) -> Flattened<U, S, T, Self, Vec<U>>
fn flatten_into_vec<U, S>(self) -> Flattened<U, S, T, Self, Vec<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>
fn flatten_into_container<U, S, C: Container<U>>( self, ) -> Flattened<U, S, T, Self, C>
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,
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 or<P: Parser<T>>(self, other: P) -> Choice<(Self, P), T>where
Self: Sized,
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,
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,
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,
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,
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§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>
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>
fn parse_inner(&self, input: &mut ParserInput<'_>) -> ParserResult<Output>
Inner parsing function, to implement
Source§fn parse(&self, input: &mut ParserInput<'_>) -> ParserResult<T>
fn parse(&self, input: &mut ParserInput<'_>) -> ParserResult<T>
Parse an input with the current parser Read more
Source§fn parse_str_with_file_id(&self, str: &str, file_id: FileId) -> ParserResult<T>
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,
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,
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,
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,
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,
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,
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,
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,
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 map<U, F: Fn(T) -> U>(self, mapper: F) -> Map<T, Self, U, F>where
Self: Sized,
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,
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,
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,
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,
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 collect<C>(self) -> Map<T, Self, C, fn(T) -> C>
fn collect<C>(self) -> Map<T, Self, C, fn(T) -> C>
Collect the parsed value using the provided iterator type
Source§fn collect_string(self) -> StringCollected<T, Self>where
Self: Sized,
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,
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,
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,
fn critical_auto_msg(self) -> Critical<T, Self>where
Self: Sized,
Mark the parser as critical Read more
Source§fn padded_by<P, PP: Parser<P>>(self, padding: PP) -> Padded<T, Self, P, PP>where
Self: Sized,
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,
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,
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,
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,
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,
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>
fn flatten<U, S>(self) -> Flattened<U, S, T, Self, NoAllocContainer>
Flatten the parser Read more
Source§fn flatten_into_vec<U, S>(self) -> Flattened<U, S, T, Self, Vec<U>>
fn flatten_into_vec<U, S>(self) -> Flattened<U, S, T, Self, Vec<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>
fn flatten_into_container<U, S, C: Container<U>>( self, ) -> Flattened<U, S, T, Self, C>
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,
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 or<P: Parser<T>>(self, other: P) -> Choice<(Self, P), T>where
Self: Sized,
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,
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,
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,
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,
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§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>
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>
fn parse_inner(&self, input: &mut ParserInput<'_>) -> ParserResult<Output>
Inner parsing function, to implement
Source§fn parse(&self, input: &mut ParserInput<'_>) -> ParserResult<T>
fn parse(&self, input: &mut ParserInput<'_>) -> ParserResult<T>
Parse an input with the current parser Read more
Source§fn parse_str_with_file_id(&self, str: &str, file_id: FileId) -> ParserResult<T>
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,
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,
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,
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,
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,
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,
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,
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,
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 map<U, F: Fn(T) -> U>(self, mapper: F) -> Map<T, Self, U, F>where
Self: Sized,
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,
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,
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,
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,
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 collect<C>(self) -> Map<T, Self, C, fn(T) -> C>
fn collect<C>(self) -> Map<T, Self, C, fn(T) -> C>
Collect the parsed value using the provided iterator type
Source§fn collect_string(self) -> StringCollected<T, Self>where
Self: Sized,
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,
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,
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,
fn critical_auto_msg(self) -> Critical<T, Self>where
Self: Sized,
Mark the parser as critical Read more
Source§fn padded_by<P, PP: Parser<P>>(self, padding: PP) -> Padded<T, Self, P, PP>where
Self: Sized,
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,
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,
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,
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,
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,
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>
fn flatten<U, S>(self) -> Flattened<U, S, T, Self, NoAllocContainer>
Flatten the parser Read more
Source§fn flatten_into_vec<U, S>(self) -> Flattened<U, S, T, Self, Vec<U>>
fn flatten_into_vec<U, S>(self) -> Flattened<U, S, T, Self, Vec<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>
fn flatten_into_container<U, S, C: Container<U>>( self, ) -> Flattened<U, S, T, Self, C>
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,
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 or<P: Parser<T>>(self, other: P) -> Choice<(Self, P), T>where
Self: Sized,
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,
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,
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,
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,
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§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>
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>
fn parse_inner(&self, input: &mut ParserInput<'_>) -> ParserResult<Output>
Inner parsing function, to implement
Source§fn parse(&self, input: &mut ParserInput<'_>) -> ParserResult<T>
fn parse(&self, input: &mut ParserInput<'_>) -> ParserResult<T>
Parse an input with the current parser Read more
Source§fn parse_str_with_file_id(&self, str: &str, file_id: FileId) -> ParserResult<T>
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,
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,
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,
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,
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,
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,
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,
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,
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 map<U, F: Fn(T) -> U>(self, mapper: F) -> Map<T, Self, U, F>where
Self: Sized,
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,
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,
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,
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,
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 collect<C>(self) -> Map<T, Self, C, fn(T) -> C>
fn collect<C>(self) -> Map<T, Self, C, fn(T) -> C>
Collect the parsed value using the provided iterator type
Source§fn collect_string(self) -> StringCollected<T, Self>where
Self: Sized,
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,
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,
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,
fn critical_auto_msg(self) -> Critical<T, Self>where
Self: Sized,
Mark the parser as critical Read more
Source§fn padded_by<P, PP: Parser<P>>(self, padding: PP) -> Padded<T, Self, P, PP>where
Self: Sized,
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,
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,
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,
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,
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,
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>
fn flatten<U, S>(self) -> Flattened<U, S, T, Self, NoAllocContainer>
Flatten the parser Read more
Source§fn flatten_into_vec<U, S>(self) -> Flattened<U, S, T, Self, Vec<U>>
fn flatten_into_vec<U, S>(self) -> Flattened<U, S, T, Self, Vec<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>
fn flatten_into_container<U, S, C: Container<U>>( self, ) -> Flattened<U, S, T, Self, C>
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,
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 or<P: Parser<T>>(self, other: P) -> Choice<(Self, P), T>where
Self: Sized,
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,
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,
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,
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,
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§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>
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>
fn parse_inner(&self, input: &mut ParserInput<'_>) -> ParserResult<Output>
Inner parsing function, to implement
Source§fn parse(&self, input: &mut ParserInput<'_>) -> ParserResult<T>
fn parse(&self, input: &mut ParserInput<'_>) -> ParserResult<T>
Parse an input with the current parser Read more
Source§fn parse_str_with_file_id(&self, str: &str, file_id: FileId) -> ParserResult<T>
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,
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,
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,
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,
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,
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,
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,
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,
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 map<U, F: Fn(T) -> U>(self, mapper: F) -> Map<T, Self, U, F>where
Self: Sized,
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,
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,
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,
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,
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 collect<C>(self) -> Map<T, Self, C, fn(T) -> C>
fn collect<C>(self) -> Map<T, Self, C, fn(T) -> C>
Collect the parsed value using the provided iterator type
Source§fn collect_string(self) -> StringCollected<T, Self>where
Self: Sized,
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,
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,
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,
fn critical_auto_msg(self) -> Critical<T, Self>where
Self: Sized,
Mark the parser as critical Read more
Source§fn padded_by<P, PP: Parser<P>>(self, padding: PP) -> Padded<T, Self, P, PP>where
Self: Sized,
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,
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,
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,
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,
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,
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>
fn flatten<U, S>(self) -> Flattened<U, S, T, Self, NoAllocContainer>
Flatten the parser Read more
Source§fn flatten_into_vec<U, S>(self) -> Flattened<U, S, T, Self, Vec<U>>
fn flatten_into_vec<U, S>(self) -> Flattened<U, S, T, Self, Vec<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>
fn flatten_into_container<U, S, C: Container<U>>( self, ) -> Flattened<U, S, T, Self, C>
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,
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 or<P: Parser<T>>(self, other: P) -> Choice<(Self, P), T>where
Self: Sized,
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,
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,
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,
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,
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§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>
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>
fn parse_inner(&self, input: &mut ParserInput<'_>) -> ParserResult<Output>
Inner parsing function, to implement
Source§fn parse(&self, input: &mut ParserInput<'_>) -> ParserResult<T>
fn parse(&self, input: &mut ParserInput<'_>) -> ParserResult<T>
Parse an input with the current parser Read more
Source§fn parse_str_with_file_id(&self, str: &str, file_id: FileId) -> ParserResult<T>
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,
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,
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,
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,
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,
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,
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,
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,
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 map<U, F: Fn(T) -> U>(self, mapper: F) -> Map<T, Self, U, F>where
Self: Sized,
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,
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,
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,
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,
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 collect<C>(self) -> Map<T, Self, C, fn(T) -> C>
fn collect<C>(self) -> Map<T, Self, C, fn(T) -> C>
Collect the parsed value using the provided iterator type
Source§fn collect_string(self) -> StringCollected<T, Self>where
Self: Sized,
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,
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,
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,
fn critical_auto_msg(self) -> Critical<T, Self>where
Self: Sized,
Mark the parser as critical Read more
Source§fn padded_by<P, PP: Parser<P>>(self, padding: PP) -> Padded<T, Self, P, PP>where
Self: Sized,
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,
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,
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,
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,
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,
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>
fn flatten<U, S>(self) -> Flattened<U, S, T, Self, NoAllocContainer>
Flatten the parser Read more
Source§fn flatten_into_vec<U, S>(self) -> Flattened<U, S, T, Self, Vec<U>>
fn flatten_into_vec<U, S>(self) -> Flattened<U, S, T, Self, Vec<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>
fn flatten_into_container<U, S, C: Container<U>>( self, ) -> Flattened<U, S, T, Self, C>
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,
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 or<P: Parser<T>>(self, other: P) -> Choice<(Self, P), T>where
Self: Sized,
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,
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,
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,
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,
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§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>
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>
fn parse_inner(&self, input: &mut ParserInput<'_>) -> ParserResult<Output>
Inner parsing function, to implement
Source§fn parse(&self, input: &mut ParserInput<'_>) -> ParserResult<T>
fn parse(&self, input: &mut ParserInput<'_>) -> ParserResult<T>
Parse an input with the current parser Read more
Source§fn parse_str_with_file_id(&self, str: &str, file_id: FileId) -> ParserResult<T>
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,
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,
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,
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,
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,
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,
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,
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,
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 map<U, F: Fn(T) -> U>(self, mapper: F) -> Map<T, Self, U, F>where
Self: Sized,
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,
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,
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,
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,
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 collect<C>(self) -> Map<T, Self, C, fn(T) -> C>
fn collect<C>(self) -> Map<T, Self, C, fn(T) -> C>
Collect the parsed value using the provided iterator type
Source§fn collect_string(self) -> StringCollected<T, Self>where
Self: Sized,
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,
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,
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,
fn critical_auto_msg(self) -> Critical<T, Self>where
Self: Sized,
Mark the parser as critical Read more
Source§fn padded_by<P, PP: Parser<P>>(self, padding: PP) -> Padded<T, Self, P, PP>where
Self: Sized,
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,
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,
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,
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,
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,
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>
fn flatten<U, S>(self) -> Flattened<U, S, T, Self, NoAllocContainer>
Flatten the parser Read more
Source§fn flatten_into_vec<U, S>(self) -> Flattened<U, S, T, Self, Vec<U>>
fn flatten_into_vec<U, S>(self) -> Flattened<U, S, T, Self, Vec<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>
fn flatten_into_container<U, S, C: Container<U>>( self, ) -> Flattened<U, S, T, Self, C>
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,
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 or<P: Parser<T>>(self, other: P) -> Choice<(Self, P), T>where
Self: Sized,
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,
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,
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,
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,
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§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>
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>
fn parse_inner(&self, input: &mut ParserInput<'_>) -> ParserResult<Output>
Inner parsing function, to implement
Source§fn parse(&self, input: &mut ParserInput<'_>) -> ParserResult<T>
fn parse(&self, input: &mut ParserInput<'_>) -> ParserResult<T>
Parse an input with the current parser Read more
Source§fn parse_str_with_file_id(&self, str: &str, file_id: FileId) -> ParserResult<T>
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,
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,
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,
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,
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,
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,
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,
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,
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 map<U, F: Fn(T) -> U>(self, mapper: F) -> Map<T, Self, U, F>where
Self: Sized,
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,
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,
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,
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,
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 collect<C>(self) -> Map<T, Self, C, fn(T) -> C>
fn collect<C>(self) -> Map<T, Self, C, fn(T) -> C>
Collect the parsed value using the provided iterator type
Source§fn collect_string(self) -> StringCollected<T, Self>where
Self: Sized,
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,
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,
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,
fn critical_auto_msg(self) -> Critical<T, Self>where
Self: Sized,
Mark the parser as critical Read more
Source§fn padded_by<P, PP: Parser<P>>(self, padding: PP) -> Padded<T, Self, P, PP>where
Self: Sized,
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,
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,
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,
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,
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,
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>
fn flatten<U, S>(self) -> Flattened<U, S, T, Self, NoAllocContainer>
Flatten the parser Read more
Source§fn flatten_into_vec<U, S>(self) -> Flattened<U, S, T, Self, Vec<U>>
fn flatten_into_vec<U, S>(self) -> Flattened<U, S, T, Self, Vec<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>
fn flatten_into_container<U, S, C: Container<U>>( self, ) -> Flattened<U, S, T, Self, C>
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,
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 or<P: Parser<T>>(self, other: P) -> Choice<(Self, P), T>where
Self: Sized,
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,
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,
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,
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,
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§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>
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>
fn parse_inner(&self, input: &mut ParserInput<'_>) -> ParserResult<Output>
Inner parsing function, to implement
Source§fn parse(&self, input: &mut ParserInput<'_>) -> ParserResult<T>
fn parse(&self, input: &mut ParserInput<'_>) -> ParserResult<T>
Parse an input with the current parser Read more
Source§fn parse_str_with_file_id(&self, str: &str, file_id: FileId) -> ParserResult<T>
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,
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,
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,
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,
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,
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,
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,
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,
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 map<U, F: Fn(T) -> U>(self, mapper: F) -> Map<T, Self, U, F>where
Self: Sized,
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,
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,
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,
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,
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 collect<C>(self) -> Map<T, Self, C, fn(T) -> C>
fn collect<C>(self) -> Map<T, Self, C, fn(T) -> C>
Collect the parsed value using the provided iterator type
Source§fn collect_string(self) -> StringCollected<T, Self>where
Self: Sized,
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,
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,
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,
fn critical_auto_msg(self) -> Critical<T, Self>where
Self: Sized,
Mark the parser as critical Read more
Source§fn padded_by<P, PP: Parser<P>>(self, padding: PP) -> Padded<T, Self, P, PP>where
Self: Sized,
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,
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,
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,
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,
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,
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>
fn flatten<U, S>(self) -> Flattened<U, S, T, Self, NoAllocContainer>
Flatten the parser Read more
Source§fn flatten_into_vec<U, S>(self) -> Flattened<U, S, T, Self, Vec<U>>
fn flatten_into_vec<U, S>(self) -> Flattened<U, S, T, Self, Vec<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>
fn flatten_into_container<U, S, C: Container<U>>( self, ) -> Flattened<U, S, T, Self, C>
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,
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 or<P: Parser<T>>(self, other: P) -> Choice<(Self, P), T>where
Self: Sized,
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,
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,
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,
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,
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§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>
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>
fn parse_inner(&self, input: &mut ParserInput<'_>) -> ParserResult<Output>
Inner parsing function, to implement
Source§fn parse(&self, input: &mut ParserInput<'_>) -> ParserResult<T>
fn parse(&self, input: &mut ParserInput<'_>) -> ParserResult<T>
Parse an input with the current parser Read more
Source§fn parse_str_with_file_id(&self, str: &str, file_id: FileId) -> ParserResult<T>
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,
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,
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,
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,
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,
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,
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,
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,
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 map<U, F: Fn(T) -> U>(self, mapper: F) -> Map<T, Self, U, F>where
Self: Sized,
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,
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,
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,
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,
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 collect<C>(self) -> Map<T, Self, C, fn(T) -> C>
fn collect<C>(self) -> Map<T, Self, C, fn(T) -> C>
Collect the parsed value using the provided iterator type
Source§fn collect_string(self) -> StringCollected<T, Self>where
Self: Sized,
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,
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,
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,
fn critical_auto_msg(self) -> Critical<T, Self>where
Self: Sized,
Mark the parser as critical Read more
Source§fn padded_by<P, PP: Parser<P>>(self, padding: PP) -> Padded<T, Self, P, PP>where
Self: Sized,
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,
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,
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,
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,
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,
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>
fn flatten<U, S>(self) -> Flattened<U, S, T, Self, NoAllocContainer>
Flatten the parser Read more
Source§fn flatten_into_vec<U, S>(self) -> Flattened<U, S, T, Self, Vec<U>>
fn flatten_into_vec<U, S>(self) -> Flattened<U, S, T, Self, Vec<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>
fn flatten_into_container<U, S, C: Container<U>>( self, ) -> Flattened<U, S, T, Self, C>
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,
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 or<P: Parser<T>>(self, other: P) -> Choice<(Self, P), T>where
Self: Sized,
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,
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,
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,
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,
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§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>
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>
fn parse_inner(&self, input: &mut ParserInput<'_>) -> ParserResult<Output>
Inner parsing function, to implement
Source§fn parse(&self, input: &mut ParserInput<'_>) -> ParserResult<T>
fn parse(&self, input: &mut ParserInput<'_>) -> ParserResult<T>
Parse an input with the current parser Read more
Source§fn parse_str_with_file_id(&self, str: &str, file_id: FileId) -> ParserResult<T>
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,
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,
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,
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,
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,
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,
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,
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,
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 map<U, F: Fn(T) -> U>(self, mapper: F) -> Map<T, Self, U, F>where
Self: Sized,
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,
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,
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,
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,
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 collect<C>(self) -> Map<T, Self, C, fn(T) -> C>
fn collect<C>(self) -> Map<T, Self, C, fn(T) -> C>
Collect the parsed value using the provided iterator type
Source§fn collect_string(self) -> StringCollected<T, Self>where
Self: Sized,
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,
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,
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,
fn critical_auto_msg(self) -> Critical<T, Self>where
Self: Sized,
Mark the parser as critical Read more
Source§fn padded_by<P, PP: Parser<P>>(self, padding: PP) -> Padded<T, Self, P, PP>where
Self: Sized,
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,
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,
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,
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,
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,
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>
fn flatten<U, S>(self) -> Flattened<U, S, T, Self, NoAllocContainer>
Flatten the parser Read more
Source§fn flatten_into_vec<U, S>(self) -> Flattened<U, S, T, Self, Vec<U>>
fn flatten_into_vec<U, S>(self) -> Flattened<U, S, T, Self, Vec<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>
fn flatten_into_container<U, S, C: Container<U>>( self, ) -> Flattened<U, S, T, Self, C>
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,
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 or<P: Parser<T>>(self, other: P) -> Choice<(Self, P), T>where
Self: Sized,
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,
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,
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,
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,
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§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>
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>
fn parse_inner(&self, input: &mut ParserInput<'_>) -> ParserResult<Output>
Inner parsing function, to implement
Source§fn parse(&self, input: &mut ParserInput<'_>) -> ParserResult<T>
fn parse(&self, input: &mut ParserInput<'_>) -> ParserResult<T>
Parse an input with the current parser Read more
Source§fn parse_str_with_file_id(&self, str: &str, file_id: FileId) -> ParserResult<T>
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,
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,
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,
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,
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,
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,
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,
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,
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 map<U, F: Fn(T) -> U>(self, mapper: F) -> Map<T, Self, U, F>where
Self: Sized,
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,
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,
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,
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,
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 collect<C>(self) -> Map<T, Self, C, fn(T) -> C>
fn collect<C>(self) -> Map<T, Self, C, fn(T) -> C>
Collect the parsed value using the provided iterator type
Source§fn collect_string(self) -> StringCollected<T, Self>where
Self: Sized,
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,
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,
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,
fn critical_auto_msg(self) -> Critical<T, Self>where
Self: Sized,
Mark the parser as critical Read more
Source§fn padded_by<P, PP: Parser<P>>(self, padding: PP) -> Padded<T, Self, P, PP>where
Self: Sized,
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,
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,
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,
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,
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,
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>
fn flatten<U, S>(self) -> Flattened<U, S, T, Self, NoAllocContainer>
Flatten the parser Read more
Source§fn flatten_into_vec<U, S>(self) -> Flattened<U, S, T, Self, Vec<U>>
fn flatten_into_vec<U, S>(self) -> Flattened<U, S, T, Self, Vec<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>
fn flatten_into_container<U, S, C: Container<U>>( self, ) -> Flattened<U, S, T, Self, C>
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,
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 or<P: Parser<T>>(self, other: P) -> Choice<(Self, P), T>where
Self: Sized,
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,
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,
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,
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,
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§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>
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>
fn parse_inner(&self, input: &mut ParserInput<'_>) -> ParserResult<Output>
Inner parsing function, to implement
Source§fn parse(&self, input: &mut ParserInput<'_>) -> ParserResult<T>
fn parse(&self, input: &mut ParserInput<'_>) -> ParserResult<T>
Parse an input with the current parser Read more
Source§fn parse_str_with_file_id(&self, str: &str, file_id: FileId) -> ParserResult<T>
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,
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,
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,
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,
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,
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,
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,
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,
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 map<U, F: Fn(T) -> U>(self, mapper: F) -> Map<T, Self, U, F>where
Self: Sized,
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,
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,
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,
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,
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 collect<C>(self) -> Map<T, Self, C, fn(T) -> C>
fn collect<C>(self) -> Map<T, Self, C, fn(T) -> C>
Collect the parsed value using the provided iterator type
Source§fn collect_string(self) -> StringCollected<T, Self>where
Self: Sized,
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,
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,
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,
fn critical_auto_msg(self) -> Critical<T, Self>where
Self: Sized,
Mark the parser as critical Read more
Source§fn padded_by<P, PP: Parser<P>>(self, padding: PP) -> Padded<T, Self, P, PP>where
Self: Sized,
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,
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,
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,
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,
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,
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>
fn flatten<U, S>(self) -> Flattened<U, S, T, Self, NoAllocContainer>
Flatten the parser Read more
Source§fn flatten_into_vec<U, S>(self) -> Flattened<U, S, T, Self, Vec<U>>
fn flatten_into_vec<U, S>(self) -> Flattened<U, S, T, Self, Vec<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>
fn flatten_into_container<U, S, C: Container<U>>( self, ) -> Flattened<U, S, T, Self, C>
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,
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 or<P: Parser<T>>(self, other: P) -> Choice<(Self, P), T>where
Self: Sized,
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,
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,
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,
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,
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§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>
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>
fn parse_inner(&self, input: &mut ParserInput<'_>) -> ParserResult<Output>
Inner parsing function, to implement
Source§fn parse(&self, input: &mut ParserInput<'_>) -> ParserResult<T>
fn parse(&self, input: &mut ParserInput<'_>) -> ParserResult<T>
Parse an input with the current parser Read more
Source§fn parse_str_with_file_id(&self, str: &str, file_id: FileId) -> ParserResult<T>
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,
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,
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,
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,
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,
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,
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,
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,
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 map<U, F: Fn(T) -> U>(self, mapper: F) -> Map<T, Self, U, F>where
Self: Sized,
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,
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,
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,
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,
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 collect<C>(self) -> Map<T, Self, C, fn(T) -> C>
fn collect<C>(self) -> Map<T, Self, C, fn(T) -> C>
Collect the parsed value using the provided iterator type
Source§fn collect_string(self) -> StringCollected<T, Self>where
Self: Sized,
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,
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,
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,
fn critical_auto_msg(self) -> Critical<T, Self>where
Self: Sized,
Mark the parser as critical Read more
Source§fn padded_by<P, PP: Parser<P>>(self, padding: PP) -> Padded<T, Self, P, PP>where
Self: Sized,
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,
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,
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,
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,
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,
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>
fn flatten<U, S>(self) -> Flattened<U, S, T, Self, NoAllocContainer>
Flatten the parser Read more
Source§fn flatten_into_vec<U, S>(self) -> Flattened<U, S, T, Self, Vec<U>>
fn flatten_into_vec<U, S>(self) -> Flattened<U, S, T, Self, Vec<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>
fn flatten_into_container<U, S, C: Container<U>>( self, ) -> Flattened<U, S, T, Self, C>
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,
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 or<P: Parser<T>>(self, other: P) -> Choice<(Self, P), T>where
Self: Sized,
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,
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,
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,
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,
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§impl<W: Parser<Output>, X: Parser<Output>, Y: Parser<Output>, Z: Parser<Output>, Output> Parser<Output> for Choice<(W, X, Y, Z), Output>
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>
fn parse_inner(&self, input: &mut ParserInput<'_>) -> ParserResult<Output>
Inner parsing function, to implement
Source§fn parse(&self, input: &mut ParserInput<'_>) -> ParserResult<T>
fn parse(&self, input: &mut ParserInput<'_>) -> ParserResult<T>
Parse an input with the current parser Read more
Source§fn parse_str_with_file_id(&self, str: &str, file_id: FileId) -> ParserResult<T>
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,
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,
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,
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,
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,
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,
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,
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,
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 map<U, F: Fn(T) -> U>(self, mapper: F) -> Map<T, Self, U, F>where
Self: Sized,
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,
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,
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,
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,
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 collect<C>(self) -> Map<T, Self, C, fn(T) -> C>
fn collect<C>(self) -> Map<T, Self, C, fn(T) -> C>
Collect the parsed value using the provided iterator type
Source§fn collect_string(self) -> StringCollected<T, Self>where
Self: Sized,
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,
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,
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,
fn critical_auto_msg(self) -> Critical<T, Self>where
Self: Sized,
Mark the parser as critical Read more
Source§fn padded_by<P, PP: Parser<P>>(self, padding: PP) -> Padded<T, Self, P, PP>where
Self: Sized,
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,
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,
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,
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,
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,
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>
fn flatten<U, S>(self) -> Flattened<U, S, T, Self, NoAllocContainer>
Flatten the parser Read more
Source§fn flatten_into_vec<U, S>(self) -> Flattened<U, S, T, Self, Vec<U>>
fn flatten_into_vec<U, S>(self) -> Flattened<U, S, T, Self, Vec<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>
fn flatten_into_container<U, S, C: Container<U>>( self, ) -> Flattened<U, S, T, Self, C>
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,
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 or<P: Parser<T>>(self, other: P) -> Choice<(Self, P), T>where
Self: Sized,
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,
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,
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,
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,
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§impl<X: Parser<Output>, Y: Parser<Output>, Z: Parser<Output>, Output> Parser<Output> for Choice<(X, Y, Z), Output>
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>
fn parse_inner(&self, input: &mut ParserInput<'_>) -> ParserResult<Output>
Inner parsing function, to implement
Source§fn parse(&self, input: &mut ParserInput<'_>) -> ParserResult<T>
fn parse(&self, input: &mut ParserInput<'_>) -> ParserResult<T>
Parse an input with the current parser Read more
Source§fn parse_str_with_file_id(&self, str: &str, file_id: FileId) -> ParserResult<T>
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,
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,
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,
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,
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,
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,
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,
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,
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 map<U, F: Fn(T) -> U>(self, mapper: F) -> Map<T, Self, U, F>where
Self: Sized,
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,
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,
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,
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,
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 collect<C>(self) -> Map<T, Self, C, fn(T) -> C>
fn collect<C>(self) -> Map<T, Self, C, fn(T) -> C>
Collect the parsed value using the provided iterator type
Source§fn collect_string(self) -> StringCollected<T, Self>where
Self: Sized,
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,
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,
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,
fn critical_auto_msg(self) -> Critical<T, Self>where
Self: Sized,
Mark the parser as critical Read more
Source§fn padded_by<P, PP: Parser<P>>(self, padding: PP) -> Padded<T, Self, P, PP>where
Self: Sized,
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,
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,
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,
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,
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,
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>
fn flatten<U, S>(self) -> Flattened<U, S, T, Self, NoAllocContainer>
Flatten the parser Read more
Source§fn flatten_into_vec<U, S>(self) -> Flattened<U, S, T, Self, Vec<U>>
fn flatten_into_vec<U, S>(self) -> Flattened<U, S, T, Self, Vec<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>
fn flatten_into_container<U, S, C: Container<U>>( self, ) -> Flattened<U, S, T, Self, C>
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,
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 or<P: Parser<T>>(self, other: P) -> Choice<(Self, P), T>where
Self: Sized,
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,
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,
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,
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,
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§impl<Y: Parser<Output>, Z: Parser<Output>, Output> Parser<Output> for Choice<(Y, Z), Output>
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>
fn parse_inner(&self, input: &mut ParserInput<'_>) -> ParserResult<Output>
Inner parsing function, to implement
Source§fn parse(&self, input: &mut ParserInput<'_>) -> ParserResult<T>
fn parse(&self, input: &mut ParserInput<'_>) -> ParserResult<T>
Parse an input with the current parser Read more
Source§fn parse_str_with_file_id(&self, str: &str, file_id: FileId) -> ParserResult<T>
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,
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,
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,
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,
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,
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,
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,
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,
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 map<U, F: Fn(T) -> U>(self, mapper: F) -> Map<T, Self, U, F>where
Self: Sized,
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,
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,
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,
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,
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 collect<C>(self) -> Map<T, Self, C, fn(T) -> C>
fn collect<C>(self) -> Map<T, Self, C, fn(T) -> C>
Collect the parsed value using the provided iterator type
Source§fn collect_string(self) -> StringCollected<T, Self>where
Self: Sized,
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,
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,
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,
fn critical_auto_msg(self) -> Critical<T, Self>where
Self: Sized,
Mark the parser as critical Read more
Source§fn padded_by<P, PP: Parser<P>>(self, padding: PP) -> Padded<T, Self, P, PP>where
Self: Sized,
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,
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,
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,
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,
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,
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>
fn flatten<U, S>(self) -> Flattened<U, S, T, Self, NoAllocContainer>
Flatten the parser Read more
Source§fn flatten_into_vec<U, S>(self) -> Flattened<U, S, T, Self, Vec<U>>
fn flatten_into_vec<U, S>(self) -> Flattened<U, S, T, Self, Vec<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>
fn flatten_into_container<U, S, C: Container<U>>( self, ) -> Flattened<U, S, T, Self, C>
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,
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 or<P: Parser<T>>(self, other: P) -> Choice<(Self, P), T>where
Self: Sized,
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,
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,
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,
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,
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§impl<Z: Parser<Output>, Output> Parser<Output> for Choice<(Z,), Output>
impl<Z: Parser<Output>, Output> Parser<Output> for Choice<(Z,), Output>
Source§fn parse_inner(&self, input: &mut ParserInput<'_>) -> ParserResult<Output>
fn parse_inner(&self, input: &mut ParserInput<'_>) -> ParserResult<Output>
Inner parsing function, to implement
Source§fn parse(&self, input: &mut ParserInput<'_>) -> ParserResult<T>
fn parse(&self, input: &mut ParserInput<'_>) -> ParserResult<T>
Parse an input with the current parser Read more
Source§fn parse_str_with_file_id(&self, str: &str, file_id: FileId) -> ParserResult<T>
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,
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,
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,
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,
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,
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,
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,
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,
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 map<U, F: Fn(T) -> U>(self, mapper: F) -> Map<T, Self, U, F>where
Self: Sized,
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,
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,
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,
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,
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 collect<C>(self) -> Map<T, Self, C, fn(T) -> C>
fn collect<C>(self) -> Map<T, Self, C, fn(T) -> C>
Collect the parsed value using the provided iterator type
Source§fn collect_string(self) -> StringCollected<T, Self>where
Self: Sized,
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,
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,
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,
fn critical_auto_msg(self) -> Critical<T, Self>where
Self: Sized,
Mark the parser as critical Read more
Source§fn padded_by<P, PP: Parser<P>>(self, padding: PP) -> Padded<T, Self, P, PP>where
Self: Sized,
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,
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,
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,
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,
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,
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>
fn flatten<U, S>(self) -> Flattened<U, S, T, Self, NoAllocContainer>
Flatten the parser Read more
Source§fn flatten_into_vec<U, S>(self) -> Flattened<U, S, T, Self, Vec<U>>
fn flatten_into_vec<U, S>(self) -> Flattened<U, S, T, Self, Vec<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>
fn flatten_into_container<U, S, C: Container<U>>( self, ) -> Flattened<U, S, T, Self, C>
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,
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 or<P: Parser<T>>(self, other: P) -> Choice<(Self, P), T>where
Self: Sized,
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,
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,
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,
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,
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
impl<T, O> Copy for Choice<T, O>
Auto Trait Implementations§
impl<T, O> Freeze for Choice<T, O>where
T: Freeze,
impl<T, O> RefUnwindSafe for Choice<T, O>where
T: RefUnwindSafe,
O: RefUnwindSafe,
impl<T, O> Send for Choice<T, O>
impl<T, O> Sync for Choice<T, O>
impl<T, O> Unpin for Choice<T, O>
impl<T, O> UnwindSafe for Choice<T, O>where
T: UnwindSafe,
O: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more