Trait peg_runtime::Parse

source ·
pub trait Parse {
    type PositionRepr: Display;

    // Required methods
    fn start<'input>(&'input self) -> usize;
    fn is_eof<'input>(&'input self, p: usize) -> bool;
    fn position_repr<'input>(&'input self, p: usize) -> Self::PositionRepr;
}
Expand description

A type that can be used as input to a parser.

Required Associated Types§

Required Methods§

source

fn start<'input>(&'input self) -> usize

source

fn is_eof<'input>(&'input self, p: usize) -> bool

source

fn position_repr<'input>(&'input self, p: usize) -> Self::PositionRepr

Implementations on Foreign Types§

source§

impl Parse for str

§

type PositionRepr = LineCol

source§

fn start(&self) -> usize

source§

fn is_eof(&self, pos: usize) -> bool

source§

fn position_repr(&self, pos: usize) -> LineCol

source§

impl<T> Parse for [T]

§

type PositionRepr = usize

source§

fn start(&self) -> usize

source§

fn is_eof(&self, pos: usize) -> bool

source§

fn position_repr(&self, pos: usize) -> usize

Implementors§