combine::stream::position

Trait Positioner

Source
pub trait Positioner<Item> {
    type Position: Clone + Ord;
    type Checkpoint: Clone;

    // Required methods
    fn position(&self) -> Self::Position;
    fn update(&mut self, token: &Item);
    fn checkpoint(&self) -> Self::Checkpoint;
    fn reset(&mut self, checkpoint: Self::Checkpoint);
}
Expand description

Trait for tracking the current position of a Stream.

Required Associated Types§

Source

type Position: Clone + Ord

The type which keeps track of the position

Source

type Checkpoint: Clone

Required Methods§

Source

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

Returns the current position

Source

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

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

Source

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

Source

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

Implementations on Foreign Types§

Source§

impl<Item, T> Positioner<Item> for &mut T
where Item: Clone, T: ?Sized + Positioner<Item>,

Source§

type Position = <T as Positioner<Item>>::Position

Source§

type Checkpoint = <T as Positioner<Item>>::Checkpoint

Source§

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

Source§

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

Source§

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

Source§

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

Implementors§