Struct ucglib::ast::Position[][src]

pub struct Position {
    pub file: Option<PathBuf>,
    pub line: usize,
    pub column: usize,
    pub offset: usize,
}

Represents a line and a column position in UCG code.

It is used for generating error messages mostly. Most all parts of the UCG AST have a positioned associated with them.

Fields

file: Option<PathBuf>line: usizecolumn: usizeoffset: usize

Implementations

impl Position[src]

pub fn new(line: usize, column: usize, offset: usize) -> Self[src]

Construct a new Position.

pub fn with_file<P: Into<PathBuf>>(self, file: P) -> Self[src]

Trait Implementations

impl Clone for Position[src]

impl Debug for Position[src]

impl Display for Position[src]

impl Eq for Position[src]

impl<'a> From<&'a OffsetStrIter<'a>> for Position[src]

impl<'a> From<&'a Position> for Position[src]

impl<'a> From<&'a SliceIter<'a, Token>> for Position[src]

impl Hash for Position[src]

impl Ord for Position[src]

impl PartialEq<Position> for Position[src]

impl PartialOrd<Position> for Position[src]

impl StructuralEq for Position[src]

impl StructuralPartialEq for Position[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.