Struct rustla::parser::line_cursor::LineCursor[][src]

pub struct LineCursor { /* fields omitted */ }

LineCursor

A line cursor type of a parser that holds the start line and offset from it. The relative offset cursor is used to actually access the source lines’ contents, whereas the sum of relative and absolute cursors is used mainly for debug prints and|or error messages.

Implementations

impl LineCursor[src]

pub fn new(relative: Line, absolute: Line) -> Self[src]

A LineCursor constructor.

pub fn relative_offset(&self) -> Line[src]

Retrieves the line relative to the baseline that a (nested) parser is on.

pub fn relative_offset_mut_ref(&mut self) -> &mut Line[src]

Retrieves a mutable reference to the line that the (nested) parser is on.

pub fn increment_by(&mut self, amount: Line)[src]

Increments relative offset by given amount.

pub fn sum_total(&self) -> Line[src]

Returns the sum total of self.relative_offset and *self.baseline.

Trait Implementations

impl Debug for LineCursor[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, 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.