[][src]Struct lip::BoxedParser

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

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]

Box any type that implements the Parser trait

Trait Implementations

impl<'a, Output, State> Parser<'a, Output, State> for BoxedParser<'a, Output, State> where
    State: Clone
[src]

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

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]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.