Struct lib_ruby_parser::Loc[][src]

pub struct Loc {
    pub begin: usize,
    pub end: usize,
}

Fields

begin: usizeend: usize

Implementations

impl Loc[src]

pub fn new(begin: usize, end: usize) -> Self[src]

pub fn validate(&self, input: &Input)[src]

pub fn begin(&self) -> Self[src]

pub fn end(&self) -> Self[src]

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

pub fn with_begin(&self, begin: usize) -> Self[src]

pub fn with_end(&self, end: usize) -> Self[src]

pub fn with(&self, begin: usize, end: usize) -> Self[src]

pub fn adjust_begin(&self, d: i32) -> Self[src]

pub fn adjust_end(&self, d: i32) -> Self[src]

pub fn resize(&self, new_size: usize) -> Self[src]

pub fn join(&self, other: &Self) -> Self[src]

pub fn is_empty(&self) -> bool[src]

pub fn begin_line_col(&self, input: &Input) -> Option<(usize, usize)>[src]

pub fn end_line_col(&self, input: &Input) -> Option<(usize, usize)>[src]

pub fn expand_to_line(&self, input: &Input) -> Option<(usize, Self)>[src]

pub fn source(&self, input: &Input) -> Option<String>[src]

impl Loc[src]

pub fn to_range(&self) -> Range<usize>[src]

Converts location to a range

Trait Implementations

impl Clone for Loc[src]

impl Debug for Loc[src]

impl Default for Loc[src]

impl PartialEq<Loc> for Loc[src]

impl StructuralPartialEq for Loc[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, 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.