Trait Input

Source
pub trait Input: Default {
    type Position: Position;
    type Error: Error<Position = Self::Position>;

    // Required methods
    fn next(
        &self,
        pos: Self::Position,
    ) -> Result<(char, Self::Position), Self::Error>;
    fn next_range(
        &self,
        start: Self::Position,
        counts: u32,
    ) -> Result<(&str, Self::Position), Self::Error>;
    fn error_at(&self, pos: Self::Position, reason: &'static str) -> Self::Error;
}

Required Associated Types§

Source

type Position: Position

Source

type Error: Error<Position = Self::Position>

Required Methods§

Source

fn next( &self, pos: Self::Position, ) -> Result<(char, Self::Position), Self::Error>

Source

fn next_range( &self, start: Self::Position, counts: u32, ) -> Result<(&str, Self::Position), Self::Error>

Source

fn error_at(&self, pos: Self::Position, reason: &'static str) -> Self::Error

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl Input for &str

Source§

type Position = SimplePosition

Source§

type Error = SimpleError

Source§

fn next( &self, pos: Self::Position, ) -> Result<(char, Self::Position), Self::Error>

Source§

fn next_range( &self, start: Self::Position, counts: u32, ) -> Result<(&str, Self::Position), Self::Error>

Source§

fn error_at(&self, pos: Self::Position, reason: &'static str) -> Self::Error

Implementors§