Trait Posable

Source
pub trait Posable<F> {
    // Required method
    fn get_pos(&self) -> &Position<F>;

    // Provided methods
    fn file(&self) -> &F { ... }
    fn line(&self) -> u32 { ... }
    fn column(&self) -> u32 { ... }
}
Expand description

A trait for objects with an associated position

You can freely implement this trait for your objects or instead use Pos wrapper.

Required Methods§

Source

fn get_pos(&self) -> &Position<F>

Get current position

Provided Methods§

Source

fn file(&self) -> &F

Get current file location

Source

fn line(&self) -> u32

Get line number

Source

fn column(&self) -> u32

Get column number

Implementors§

Source§

impl<F> Posable<F> for NoMatch<F>

Source§

impl<T, F> Posable<F> for Pos<T, F>