Trait Positioner

Source
pub trait Positioner: Clone + PartialEq {
    type Position: Clone + Ord;

    // Required methods
    fn start() -> Self::Position;
    fn update(&self, position: &mut Self::Position);
}
Expand description

Positioner represents the operations needed to update a position given an item from the stream When implementing stream for custom token type this must be implemented for that token to allow the position to be updated

Required Associated Types§

Required Methods§

Source

fn start() -> Self::Position

Creates a start position

Source

fn update(&self, position: &mut Self::Position)

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

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 Positioner for char

Source§

impl Positioner for u8

Source§

impl<'a, T> Positioner for &'a T
where T: Positioner,

Source§

type Position = <T as Positioner>::Position

Source§

fn start() -> <T as Positioner>::Position

Source§

fn update(&self, position: &mut <T as Positioner>::Position)

Implementors§