[][src]Trait pear::Input

pub trait Input: Sized {
    type Token: PartialEq + Copy;
    type Slice: PartialEq + Clone + Length;
    type InSlice: PartialEq + Clone + Length;
    type Many: Length;
    type Context: Display;
    fn peek(&mut self) -> Option<Self::Token>;
fn peek_slice(&mut self, _: Self::InSlice) -> Option<Self::Slice>;
fn advance(&mut self, _: usize);
fn is_empty(&mut self) -> bool;
fn take_many<F: FnMut(Self::Token) -> bool>(
        &mut self,
        cond: F
    ) -> Self::Many;
fn skip_many<F: FnMut(Self::Token) -> bool>(&mut self, cond: F) -> usize; fn context(&mut self) -> Option<Self::Context> { ... } }

Associated Types

Loading content...

Required methods

fn peek(&mut self) -> Option<Self::Token>

fn peek_slice(&mut self, _: Self::InSlice) -> Option<Self::Slice>

fn advance(&mut self, _: usize)

fn is_empty(&mut self) -> bool

fn take_many<F: FnMut(Self::Token) -> bool>(&mut self, cond: F) -> Self::Many

fn skip_many<F: FnMut(Self::Token) -> bool>(&mut self, cond: F) -> usize

Loading content...

Provided methods

fn context(&mut self) -> Option<Self::Context>

Loading content...

Implementations on Foreign Types

impl<'a> Input for &'a str[src]

type Token = char

type InSlice = &'a str

type Slice = &'a str

type Many = Self::Slice

type Context = &'a str

impl<'a> Input for &'a [u8][src]

type Token = u8

type InSlice = &'a [u8]

type Slice = &'a [u8]

type Many = Self::Slice

type Context = &'a str

Loading content...

Implementors

impl<'a> Input for Text<'a>[src]

type Token = char

type InSlice = &'a str

type Slice = &'a str

type Many = Self::Slice

type Context = Position<'a>

impl<'s> Input for StringFile<'s>[src]

type Token = char

type InSlice = &'s str

type Slice = &'s str

type Many = String

type Context = &'s str

Loading content...