Struct Parser

Source
pub struct Parser<T> { /* private fields */ }

Implementations§

Source§

impl<T> Parser<T>

Source

pub fn new<F>(f: F) -> Parser<T>
where F: FnMut(VecDeque<char>) -> (VecDeque<char>, Result<T, String>) + 'static,

Source§

impl<T: Default> Parser<T>

Source

pub fn empty() -> Parser<T>

Source§

impl<T> Parser<T>

Source

pub fn failed() -> Parser<T>

Source§

impl<T> Parser<T>

Source

pub fn _run( &mut self, input: VecDeque<char>, ) -> (VecDeque<char>, Result<T, String>)

Source

pub fn run<S: Display>(&mut self, input: S) -> Result<T, String>

Source

pub fn drun<S: Display>(&mut self, input: S) -> Result<T, String>

Source§

impl Parser<String>

Source

pub fn parse_until<F>(p: F) -> Parser<String>
where F: FnMut(char) -> bool + 'static,

Source§

impl<T: 'static> Parser<T>

Source

pub fn map<U, F>(self, f: F) -> Parser<U>
where F: FnMut(T) -> U + 'static,

Source§

impl<T: 'static> Parser<T>

Source

pub fn bind<U, F>(self, f: F) -> Parser<U>
where F: FnMut(T) -> Parser<U> + 'static,

Trait Implementations§

Source§

impl<T: 'static, U: 'static> BitAnd<Parser<U>> for Parser<T>

Source§

type Output = Parser<(T, U)>

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: Parser<U>) -> Self::Output

Performs the & operation. Read more
Source§

impl<T: 'static, U: 'static> BitOr<Parser<U>> for Parser<T>

Source§

type Output = Parser<Either<T, U>>

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: Parser<U>) -> Self::Output

Performs the | operation. Read more
Source§

impl<T: 'static, U: 'static> Shl<Parser<U>> for Parser<T>

Source§

type Output = Parser<T>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: Parser<U>) -> Self::Output

Performs the << operation. Read more
Source§

impl<T: 'static, U: 'static> Shr<Parser<U>> for Parser<T>

Source§

type Output = Parser<U>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: Parser<U>) -> Self::Output

Performs the >> operation. Read more

Auto Trait Implementations§

§

impl<T> Freeze for Parser<T>

§

impl<T> !RefUnwindSafe for Parser<T>

§

impl<T> !Send for Parser<T>

§

impl<T> !Sync for Parser<T>

§

impl<T> Unpin for Parser<T>

§

impl<T> !UnwindSafe for Parser<T>

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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.