Struct lip::BoxedParser[][src]

pub struct BoxedParser<'a, Output, State> { /* fields omitted */ }
Expand description

Box Parser trait so its size is decidable in compile time.

Essentially allocate the Parser on the heap in runtime. Makes passing Parser around much easier because types that impl trait may be different under the hood while BoxedParser is always a pointer to a place in the heap.

Implementations

Box any type that implements the Parser trait

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Parse a given input, starting at a given location and state. Read more

Run the parser on a given input, starting at the first character. Read more

Map the output to a new output if parse succeeds. Otherwise, return error as usual. Read more

The map function is supplied both the output and the state of the parser. Otherwise, return error as usual. Read more

Map the error message to a new message if parse fails. Otherwise, return output as usual. Read more

Returns a new parser which is given the current output if parse succeeds. Otherwise, return error as usual. Read more

Judge if the output meets the requirement using a predicate function if the parse succeeds. Otherwise, return error as usual. Read more

Ignore the parse output and return () (emtpy tuple)

Update the state given the new output and state of the parse if parse succeeds. Otherwise, return error as usual. Read more

Update the result of the parser if parse succeeds. Otherwise, return error as usual. Read more

Check if you have reached the end of the input you are parsing. Read more

Keep values in a parser pipeline. Read more

Skip values in a parser pipeline. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.