Trait minparser::Posable

source ·
pub trait Posable
where Self: Sized,
{ // Provided methods fn at<F>(self, pos: Position<F>) -> Pos<Self, F> { ... } fn at_pos<F>(self, file: F, line: u32, column: u32) -> Pos<Self, F> { ... } }
Expand description

This trait allows you to easily create a Pos<T, F> object from a T object implementing the Posable traits thanks to its methods Posable::at and Posable::at_pos.

You don’t need T to implement Posable in order to create a Pos<T>, this trait is useful only if ypu prefer to use t.at(pos) in place of Pos::new(t, pos).

Provided Methods§

source

fn at<F>(self, pos: Position<F>) -> Pos<Self, F>

Creates a new Pos<Self, F> object. Calling t.at(pos) should be equivalent to call Pos::new(t, pos)

source

fn at_pos<F>(self, file: F, line: u32, column: u32) -> Pos<Self, F>

Creates a new Pos<Self, F> object. Calling t.at_pos(file, line, column) should be equivalent to callPos::new_pos(t, file, line, column)

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Posable for char

source§

impl<T: Posable> Posable for Option<T>

source§

impl<T: Posable, E: Posable> Posable for Result<T, E>

Implementors§