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

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

Trait for tracking the current position of a Stream.

Associated Types

type Position: Clone + Ord[src]

The type which keeps track of the position

type Checkpoint: Clone[src]

Loading content...

Required methods

pub fn position(&self) -> Self::Position[src]

Returns the current position

pub fn update(&mut self, token: &Item)[src]

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

pub fn checkpoint(&self) -> Self::Checkpoint[src]

pub fn reset(&mut self, checkpoint: Self::Checkpoint)[src]

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