Trait peg_runtime::ParseElem

source ·
pub trait ParseElem<'input>: Parse {
    type Element: Copy;

    // Required method
    fn parse_elem(&'input self, pos: usize) -> RuleResult<Self::Element>;
}
Expand description

A parser input type supporting the [...] syntax.

Required Associated Types§

source

type Element: Copy

Type of a single atomic element of the input, for example a character or token

Required Methods§

source

fn parse_elem(&'input self, pos: usize) -> RuleResult<Self::Element>

Get the element at pos, or Failed if past end of input.

Implementations on Foreign Types§

source§

impl<'input> ParseElem<'input> for str

§

type Element = char

source§

fn parse_elem(&'input self, pos: usize) -> RuleResult<char>

source§

impl<'input, T: 'input + Copy> ParseElem<'input> for [T]

§

type Element = T

source§

fn parse_elem(&'input self, pos: usize) -> RuleResult<T>

Implementors§