Struct chumsky::BoxedParser [−][src]
#[repr(transparent)]pub struct BoxedParser<'a, I, O, E: Error<I>>(_);
Expand description
See Parser::boxed
.
This type is a repr(transparent)
wrapper
around its inner value.
Due to current implementation details, the inner value is not, in fact, a Box
, but is an Rc
to facilitate
efficient cloning. This is likely to change in the future. Unlike Box
, Rc
has no size guarantees: although
it is currently the same size as a raw pointer.
Trait Implementations
type Error = E
type Error = E
The type of errors emitted by this parser.
Parse a stream of tokens, yielding an output if possible, and any errors encountered along the way. Read more
Parse a stream of tokens, yielding an output if possible, and any errors encountered along the way. Unlike
Parser::parse_recovery
, this function will produce verbose debugging output as it executes. Read more
Parse a stream of tokens, yielding an output or any errors that were encountered along the way. Read more
Include this parser in the debugging output produced by Parser::parse_recovery_verbose
. Read more
Map the output of this parser to another value. Read more
fn map_with_span<U, F: Fn(O, <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, <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 overall span. Read more
Map the primary error of this parser to another value. Read more
After a successful parse, apply a fallible function to the output. If the function produces an error, treat it as a parsing error. Read more
Validate an output, producing non-terminal errors if it does not fulfil certain criteria. 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. Read more
Right-fold the output of the parser into a single value. 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 type implementing FromIterator
. 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. Read more
fn ignore_then<U, P: Parser<I, U>>(self, other: P) -> IgnoreThen<Self, P, O, U> where
Self: Sized,
fn ignore_then<U, P: Parser<I, U>>(self, other: P) -> IgnoreThen<Self, P, O, U> where
Self: Sized,
Parse one thing and then another thing, yielding only the output of the latter. Read more
fn then_ignore<U, P: Parser<I, U>>(self, other: P) -> ThenIgnore<Self, P, O, U> where
Self: Sized,
fn then_ignore<U, P: Parser<I, U>>(self, other: P) -> ThenIgnore<Self, P, O, U> where
Self: Sized,
Parse one thing and then another thing, yielding only the output of the former. Read more
fn padded_by<U, P: Parser<I, U, Error = Self::Error> + Clone>(
self,
other: P
) -> ThenIgnore<IgnoreThen<P, Self, U, O>, P, O, U> where
Self: Sized,
fn padded_by<U, P: Parser<I, U, Error = Self::Error> + Clone>(
self,
other: P
) -> ThenIgnore<IgnoreThen<P, Self, U, O>, P, O, U> where
Self: Sized,
Parse a pattern, but with an instance of another pattern on either end, yielding the output of the inner. Read more
Parse the pattern surrounded by the given delimiters. Read more
Parse one thing or, on failure, another thing. Read more
Apply a fallback recovery strategy to this parser should it fail. 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
fn separated_by<U, P: Parser<I, U>>(self, other: P) -> SeparatedBy<Self, P, U> where
Self: Sized,
fn separated_by<U, P: Parser<I, U>>(self, other: P) -> SeparatedBy<Self, P, U> where
Self: Sized,
Parse an expression, separated by another, any number of times. Read more
Auto Trait Implementations
impl<'a, I, O, E> !RefUnwindSafe for BoxedParser<'a, I, O, E>
impl<'a, I, O, E> !Send for BoxedParser<'a, I, O, E>
impl<'a, I, O, E> !Sync for BoxedParser<'a, I, O, E>
impl<'a, I, O, E> Unpin for BoxedParser<'a, I, O, E>
impl<'a, I, O, E> !UnwindSafe for BoxedParser<'a, I, O, E>
Blanket Implementations
Mutably borrows from an owned value. Read more