[−][src]Struct lip::BoxedParser
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.
Methods
impl<'a, Output, State> BoxedParser<'a, Output, State>
[src]
pub fn new<P>(parser: P) -> Self where
P: Parser<'a, Output, State> + 'a,
State: Clone,
[src]
P: Parser<'a, Output, State> + 'a,
State: Clone,
Box any type that implements the Parser
trait
Trait Implementations
impl<'a, Output: 'a, State: 'a> Clone for BoxedParser<'a, Output, State>
[src]
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<'a, Output, State> Parser<'a, Output, State> for BoxedParser<'a, Output, State> where
State: Clone,
[src]
State: Clone,
fn parse(
&self,
input: &'a str,
location: Location,
state: State
) -> ParseResult<'a, Output, State>
[src]
&self,
input: &'a str,
location: Location,
state: State
) -> ParseResult<'a, Output, State>
fn map<F, NewOutput>(self, map_fn: F) -> BoxedParser<'a, NewOutput, State> where
Self: Sized + 'a,
Output: 'a,
NewOutput: 'a,
State: 'a,
F: Fn(Output) -> NewOutput + 'a,
[src]
Self: Sized + 'a,
Output: 'a,
NewOutput: 'a,
State: 'a,
F: Fn(Output) -> NewOutput + 'a,
fn map_with_state<F, NewOutput>(
self,
map_fn: F
) -> BoxedParser<'a, NewOutput, State> where
Self: Sized + 'a,
Output: 'a,
NewOutput: 'a,
State: 'a,
F: Fn(Output, State) -> NewOutput + 'a,
[src]
self,
map_fn: F
) -> BoxedParser<'a, NewOutput, State> where
Self: Sized + 'a,
Output: 'a,
NewOutput: 'a,
State: 'a,
F: Fn(Output, State) -> NewOutput + 'a,
fn map_err<F>(self, map_fn: F) -> BoxedParser<'a, Output, State> where
Self: Sized + 'a,
Output: 'a,
State: 'a,
F: Fn(String) -> String + 'a,
[src]
Self: Sized + 'a,
Output: 'a,
State: 'a,
F: Fn(String) -> String + 'a,
fn and_then<F, NextParser, NewOutput>(
self,
f: F
) -> BoxedParser<'a, NewOutput, State> where
Self: Sized + 'a,
Output: 'a,
NewOutput: 'a,
State: 'a,
NextParser: Parser<'a, NewOutput, State> + 'a,
F: Fn(Output) -> NextParser + 'a,
[src]
self,
f: F
) -> BoxedParser<'a, NewOutput, State> where
Self: Sized + 'a,
Output: 'a,
NewOutput: 'a,
State: 'a,
NextParser: Parser<'a, NewOutput, State> + 'a,
F: Fn(Output) -> NextParser + 'a,
fn pred<F>(
self,
predicate: F,
expecting: &'a str
) -> BoxedParser<'a, Output, State> where
Self: Sized + 'a,
Output: Display + 'a,
State: 'a,
F: Fn(&Output) -> bool + 'a,
[src]
self,
predicate: F,
expecting: &'a str
) -> BoxedParser<'a, Output, State> where
Self: Sized + 'a,
Output: Display + 'a,
State: 'a,
F: Fn(&Output) -> bool + 'a,
fn ignore(self) -> BoxedParser<'a, (), State> where
Self: Sized + 'a,
Output: 'a,
State: 'a,
[src]
Self: Sized + 'a,
Output: 'a,
State: 'a,
fn update_state<F>(self, f: F) -> BoxedParser<'a, Output, State> where
Self: Sized + 'a,
State: 'a,
Output: Clone + 'a,
F: Fn(Output, State) -> State + 'a,
[src]
Self: Sized + 'a,
State: 'a,
Output: Clone + 'a,
F: Fn(Output, State) -> State + 'a,
fn update<F, NewOutput>(self, f: F) -> BoxedParser<'a, NewOutput, State> where
Self: Sized + 'a,
State: 'a,
Output: Clone + 'a,
NewOutput: Clone + 'a,
F: Fn(&'a str, Output, Location, State) -> ParseResult<'a, NewOutput, State> + 'a,
[src]
Self: Sized + 'a,
State: 'a,
Output: Clone + 'a,
NewOutput: Clone + 'a,
F: Fn(&'a str, Output, Location, State) -> ParseResult<'a, NewOutput, State> + 'a,
fn end(self) -> BoxedParser<'a, Output, State> where
Self: Sized + 'a,
Output: Clone + 'a,
State: 'a,
[src]
Self: Sized + 'a,
Output: Clone + 'a,
State: 'a,
Auto Trait Implementations
impl<'a, Output, State> !RefUnwindSafe for BoxedParser<'a, Output, State>
impl<'a, Output, State> !Send for BoxedParser<'a, Output, State>
impl<'a, Output, State> !Sync for BoxedParser<'a, Output, State>
impl<'a, Output, State> Unpin for BoxedParser<'a, Output, State>
impl<'a, Output, State> !UnwindSafe for BoxedParser<'a, Output, State>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<'a, F, Output, State> Parser<'a, Output, State> for F where
F: Fn(&'a str, Location, State) -> ParseResult<'a, Output, State>,
State: 'a + Clone,
[src]
F: Fn(&'a str, Location, State) -> ParseResult<'a, Output, State>,
State: 'a + Clone,
fn parse(&Self, &'a str, Location, State) -> ParseResult<'a, Output, State>
[src]
fn map<F, NewOutput>(self, map_fn: F) -> BoxedParser<'a, NewOutput, State> where
Self: Sized + 'a,
Output: 'a,
NewOutput: 'a,
State: 'a,
F: Fn(Output) -> NewOutput + 'a,
[src]
Self: Sized + 'a,
Output: 'a,
NewOutput: 'a,
State: 'a,
F: Fn(Output) -> NewOutput + 'a,
fn map_with_state<F, NewOutput>(
self,
map_fn: F
) -> BoxedParser<'a, NewOutput, State> where
Self: Sized + 'a,
Output: 'a,
NewOutput: 'a,
State: 'a,
F: Fn(Output, State) -> NewOutput + 'a,
[src]
self,
map_fn: F
) -> BoxedParser<'a, NewOutput, State> where
Self: Sized + 'a,
Output: 'a,
NewOutput: 'a,
State: 'a,
F: Fn(Output, State) -> NewOutput + 'a,
fn map_err<F>(self, map_fn: F) -> BoxedParser<'a, Output, State> where
Self: Sized + 'a,
Output: 'a,
State: 'a,
F: Fn(String) -> String + 'a,
[src]
Self: Sized + 'a,
Output: 'a,
State: 'a,
F: Fn(String) -> String + 'a,
fn and_then<F, NextParser, NewOutput>(
self,
f: F
) -> BoxedParser<'a, NewOutput, State> where
Self: Sized + 'a,
Output: 'a,
NewOutput: 'a,
State: 'a,
NextParser: Parser<'a, NewOutput, State> + 'a,
F: Fn(Output) -> NextParser + 'a,
[src]
self,
f: F
) -> BoxedParser<'a, NewOutput, State> where
Self: Sized + 'a,
Output: 'a,
NewOutput: 'a,
State: 'a,
NextParser: Parser<'a, NewOutput, State> + 'a,
F: Fn(Output) -> NextParser + 'a,
fn pred<F>(
self,
predicate: F,
expecting: &'a str
) -> BoxedParser<'a, Output, State> where
Self: Sized + 'a,
Output: Display + 'a,
State: 'a,
F: Fn(&Output) -> bool + 'a,
[src]
self,
predicate: F,
expecting: &'a str
) -> BoxedParser<'a, Output, State> where
Self: Sized + 'a,
Output: Display + 'a,
State: 'a,
F: Fn(&Output) -> bool + 'a,
fn ignore(self) -> BoxedParser<'a, (), State> where
Self: Sized + 'a,
Output: 'a,
State: 'a,
[src]
Self: Sized + 'a,
Output: 'a,
State: 'a,
fn update_state<F>(self, f: F) -> BoxedParser<'a, Output, State> where
Self: Sized + 'a,
State: 'a,
Output: Clone + 'a,
F: Fn(Output, State) -> State + 'a,
[src]
Self: Sized + 'a,
State: 'a,
Output: Clone + 'a,
F: Fn(Output, State) -> State + 'a,
fn update<F, NewOutput>(self, f: F) -> BoxedParser<'a, NewOutput, State> where
Self: Sized + 'a,
State: 'a,
Output: Clone + 'a,
NewOutput: Clone + 'a,
F: Fn(&'a str, Output, Location, State) -> ParseResult<'a, NewOutput, State> + 'a,
[src]
Self: Sized + 'a,
State: 'a,
Output: Clone + 'a,
NewOutput: Clone + 'a,
F: Fn(&'a str, Output, Location, State) -> ParseResult<'a, NewOutput, State> + 'a,
fn end(self) -> BoxedParser<'a, Output, State> where
Self: Sized + 'a,
Output: Clone + 'a,
State: 'a,
[src]
Self: Sized + 'a,
Output: Clone + 'a,
State: 'a,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,