Struct chumsky::primitive::OneOf [−][src]
pub struct OneOf<I, E>(_, _);
Expand description
See one_of
.
Trait Implementations
type Error = E
type Error = E
The type of errors emitted by this parser.
Parse a stream with all the bells & whistles. You can use this to implement your own parser combinators. Note that both the signature and semantic requirements of this function are very likely to change in later versions. Where possible, prefer more ergonomic combinators provided elsewhere in the crate rather than implementing your own. Read more
Parse an iterator of tokens, yielding an output if possible, and any errors encountered along the way. Read more
Parse an iterator of tokens, yielding an output or any errors that were encountered along the way. Read more
Map the output of this parser to aanother value. Read more
fn map_with_span<U, F: Fn(O, Option<<Self::Error as Error<I>>::Span>) -> U>(
self,
f: F
) -> MapWithSpan<Self, F, O> where
Self: Sized,
fn map_with_span<U, F: Fn(O, Option<<Self::Error as Error<I>>::Span>) -> U>(
self,
f: F
) -> MapWithSpan<Self, F, O> where
Self: Sized,
Map the output of this parser to another value, making use of the pattern’s span.
Map the primary error of this parser to another value. Read more
Label the pattern parsed by this parser for more useful error messages. Read more
Transform all outputs of this parser to a pretermined value. Read more
Left-fold the output of the parser into a single value, where the output is of type (_, Vec<_>)
. Read more
Right-fold the output of the parser into a single value, where the output is of type (Vec<_>, _)
. Read more
Ignore the output of this parser, yielding ()
as an output instead. Read more
fn collect<C: FromIterator<O::Item>>(self) -> Map<Self, fn(_: O) -> C, O> where
Self: Sized,
O: IntoIterator,
fn collect<C: FromIterator<O::Item>>(self) -> Map<Self, fn(_: O) -> C, O> where
Self: Sized,
O: IntoIterator,
Collect the output of this parser into a collection. Read more
Parse one thing and then another thing, yielding a tuple of the two outputs. Read more
fn flatten<T, Inner>(self) -> Map<Self, fn(_: O) -> Vec<T>, O> where
Self: Sized,
O: IntoIterator<Item = Inner>,
Inner: IntoIterator<Item = T>,
fn flatten<T, Inner>(self) -> Map<Self, fn(_: O) -> Vec<T>, O> where
Self: Sized,
O: IntoIterator<Item = Inner>,
Inner: IntoIterator<Item = T>,
Flatten a nested collection.
fn padding_for<U, P: Parser<I, U>>(self, other: P) -> PaddingFor<Self, P, O, U> where
Self: Sized,
fn padding_for<U, P: Parser<I, U>>(self, other: P) -> PaddingFor<Self, P, O, U> where
Self: Sized,
Parse one thing and then another thing, yielding only the output of the latter. Read more
Parse one thing and then another thing, yielding only the output of the former. Read more
Parse the pattern surrounded by the given delimiters, performing error recovery where possible. Read more
Parse one thing or, on failure, another thing. Read more
Attempt to parse something, but only if it exists. Read more
Parse an expression any number of times (including zero times). Read more
Parse an expression at least a given number of times. Read more
Auto Trait Implementations
impl<I, E> RefUnwindSafe for OneOf<I, E> where
E: RefUnwindSafe,
I: RefUnwindSafe,
impl<I, E> UnwindSafe for OneOf<I, E> where
E: UnwindSafe,
I: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more