Skip to main content

RecursiveParser

Struct RecursiveParser 

Source
pub struct RecursiveParser<I: ?Sized, O, F>
where F: Fn() -> Box<dyn Parser<I = I, O = O>>,
{ /* private fields */ }

Trait Implementations§

Source§

impl<I: ?Sized, O, F> Clone for RecursiveParser<I, O, F>
where F: Fn() -> Box<dyn Parser<I = I, O = O>>,

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<I: ?Sized, O, F> Parser for RecursiveParser<I, O, F>
where F: Fn() -> Box<dyn Parser<I = I, O = O>>,

Source§

type I = I

Source§

type O = O

Source§

fn parse<'a>(&self, data: &'a Self::I) -> ParseResult<&'a Self::I, Self::O>

Source§

impl<I: ?Sized, O, F> ParserCombinator for RecursiveParser<I, O, F>
where F: Fn() -> Box<dyn Parser<I = I, O = O>>,

Source§

fn then<P: Parser<I = Self::I>>(&self, p: P) -> ChainedParser<Self, P>

Chain this parser with another parser, creating new parser that returns a tuple of their results
Source§

fn then_r<P: ParserCombinator<I = Self::I>>( &self, p: P, ) -> MapParser<Self::I, ChainedParser<Self, P>, P::O>

Chain this parser with another parser, but toss the value from this parser
Source§

fn then_l<P: ParserCombinator<I = Self::I>>( &self, p: P, ) -> MapParser<Self::I, ChainedParser<Self, P>, Self::O>

Chain this parser with another parser, but toss the value from the other parser
Source§

fn repeat(&self) -> RepeatParser<Self>

Create a new parser that will repeat this parser until it returns an error
Source§

fn map<T, F: 'static + Fn(Self::O) -> T>( &self, f: F, ) -> MapParser<Self::I, Self, T>

Map the value of this parser
Source§

fn or<P: Parser<I = Self::I, O = Self::O>>(&self, p: P) -> OrParser<Self, P>

Create a disjunction with another parser. If this parser produces an error, the other parser will be used

Auto Trait Implementations§

§

impl<I, O, F> !Send for RecursiveParser<I, O, F>

§

impl<I, O, F> !Sync for RecursiveParser<I, O, F>

§

impl<I, O, F> Freeze for RecursiveParser<I, O, F>
where Rc<F>: Freeze, I: ?Sized,

§

impl<I, O, F> RefUnwindSafe for RecursiveParser<I, O, F>
where Rc<F>: RefUnwindSafe, I: ?Sized,

§

impl<I, O, F> Unpin for RecursiveParser<I, O, F>
where Rc<F>: Unpin, I: ?Sized,

§

impl<I, O, F> UnsafeUnpin for RecursiveParser<I, O, F>
where Rc<F>: UnsafeUnpin, I: ?Sized,

§

impl<I, O, F> UnwindSafe for RecursiveParser<I, O, F>
where Rc<F>: UnwindSafe, I: ?Sized,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.