[][src]Trait combine::stream::position::Positioner

pub trait Positioner<Item> {
    type Position: Clone + Ord;
    type Checkpoint: Clone;
    fn position(&self) -> Self::Position;
fn update(&mut self, token: &Item);
fn checkpoint(&self) -> Self::Checkpoint;
fn reset(&mut self, checkpoint: Self::Checkpoint); }

Trait for tracking the current position of a Stream.

Associated Types

type Position: Clone + Ord

The type which keeps track of the position

type Checkpoint: Clone

Loading content...

Required methods

fn position(&self) -> Self::Position

Returns the current position

fn update(&mut self, token: &Item)

Updates the position given that token has been taken from the stream

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

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

Loading content...

Implementations on Foreign Types

impl<Item, T: ?Sized, '_> Positioner<Item> for &'_ mut T where
    Item: Clone,
    T: Positioner<Item>, 
[src]

type Position = T::Position

type Checkpoint = T::Checkpoint

Loading content...

Implementors

impl Positioner<char> for SourcePosition[src]

type Position = SourcePosition

type Checkpoint = Self

impl Positioner<u8> for SourcePosition[src]

type Position = SourcePosition

type Checkpoint = Self

impl<Item> Positioner<Item> for IndexPositioner where
    Item: Clone
[src]

type Position = usize

type Checkpoint = Self

Loading content...