Skip to main content

ParseElem

Trait 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.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

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

Source§

type Element = T

Source§

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

Source§

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

Source§

type Element = char

Source§

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

Implementors§