Skip to main content

Input

Trait Input 

Source
pub trait Input {
    type Checkpoint: Copy + Eq + Ord;
    type Slice<'a>
       where Self: 'a;

    // Required methods
    fn checkpoint(&self) -> Self::Checkpoint;
    fn reset(&mut self, checkpoint: Self::Checkpoint);
    fn offset(&self) -> usize;
    fn remaining(&self) -> Self::Slice<'_>;
    fn is_eof(&self) -> bool;
}

Required Associated Types§

Source

type Checkpoint: Copy + Eq + Ord

Source

type Slice<'a> where Self: 'a

Required Methods§

Source

fn checkpoint(&self) -> Self::Checkpoint

Source

fn reset(&mut self, checkpoint: Self::Checkpoint)

Source

fn offset(&self) -> usize

Source

fn remaining(&self) -> Self::Slice<'_>

Source

fn is_eof(&self) -> bool

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.

Implementors§

Source§

impl<'a> Input for StrInput<'a>

Source§

type Checkpoint = usize

Source§

type Slice<'s> = &'s str where Self: 's