Struct lang_util::error::ResolvedPosition[][src]

pub struct ResolvedPosition { /* fields omitted */ }

A position in the input stream that has been resolved into the more user-friendly line and column indices

Implementations

impl ResolvedPosition[src]

pub fn new(raw: LexerPosition, input: &str) -> ResolvedPosition[src]

Create a new resolved position

If the offset doesn’t correspond to the input string, the results are undefined.

Parameters

  • raw: raw byte offset into the input
  • input: input string the offset is to be taken into

Returns

The resolved position.

pub fn source_id(&self) -> usize[src]

Source string id for this position

pub fn offset(&self) -> usize[src]

Raw byte offset into the source string

pub fn line(&self) -> usize[src]

Line index (0 based)

pub fn col(&self) -> usize[src]

Column index (0 based)

Trait Implementations

impl Clone for ResolvedPosition[src]

impl Copy for ResolvedPosition[src]

impl Debug for ResolvedPosition[src]

impl Display for ResolvedPosition[src]

impl Eq for ResolvedPosition[src]

impl Hash for ResolvedPosition[src]

impl Ord for ResolvedPosition[src]

impl PartialEq<ResolvedPosition> for ResolvedPosition[src]

impl PartialOrd<ResolvedPosition> for ResolvedPosition[src]

impl StructuralEq for ResolvedPosition[src]

impl StructuralPartialEq for ResolvedPosition[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> IntoResult<T> for T[src]

type Err = Infallible

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.