Struct rustla::parser::line_cursor::LineCursor [−][src]
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
Auto Trait Implementations
impl RefUnwindSafe for LineCursor
impl Send for LineCursor
impl Sync for LineCursor
impl Unpin for LineCursor
impl UnwindSafe for LineCursor
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,