Trait yarpl::Expect[][src]

pub trait Expect: Debug + Clone + Any + 'static {
    type Target;
    fn expect_from(parser: &mut Parser) -> Result<Self::Target>;
}
Expand description

Implements how a Parser should consume its input to yield Self::Target.

Associated Types

type Target[src]

The type expected from parsing Self.

Required methods

fn expect_from(parser: &mut Parser) -> Result<Self::Target>[src]

What a parser will call to advance itself.

Implementors

impl Expect for Digits[src]

type Target = String

fn expect_from(parser: &mut Parser) -> Result<Self::Target> where
    Self: Sized + Debug
[src]

impl Expect for Letters[src]

type Target = String

fn expect_from(parser: &mut Parser) -> Result<Self::Target>[src]

impl Expect for Number[src]

type Target = String

fn expect_from(parser: &mut Parser) -> Result<Self::Target> where
    Self: Sized + Debug
[src]

impl Expect for Spaces[src]

type Target = String

fn expect_from(parser: &mut Parser) -> Result<Self::Target> where
    Self: Sized + Debug
[src]

impl<T: Expect> Expect for Maybe<T>[src]

type Target = Option<T::Target>

fn expect_from(parser: &mut Parser) -> Result<Self::Target>[src]

impl<T: Expect, const N: usize> Expect for Over<T, N>[src]

type Target = Vec<T::Target>

fn expect_from(parser: &mut Parser) -> Result<Self::Target>[src]

impl<T: Expect, const N: usize> Expect for Under<T, N>[src]

type Target = Vec<T::Target>

fn expect_from(parser: &mut Parser) -> Result<Self::Target>[src]

impl<const STRING: &'static str> Expect for Just<STRING>[src]

type Target = &'static str

fn expect_from(parser: &mut Parser) -> Result<Self::Target>[src]