Struct lib_ruby_parser::Loc [−][src]
Fields
begin: usizeBegin of the Loc range
end: usizeEnd of the Loc range
Implementations
impl Loc[src]
pub fn new(begin: usize, end: usize) -> LocPtr[src]
Constructs a new Loc struct
pub fn begin(&self) -> LocPtr[src]
Returns begin field of the Loc
pub fn end(&self) -> LocPtr[src]
Returns end field of the Loc
pub fn size(&self) -> usize[src]
Returns size of the Loc (i.e. end - begin)
pub fn with_begin(&self, begin: usize) -> LocPtr[src]
Returns a new Loc with given begin and current end
pub fn with_end(&self, end: usize) -> LocPtr[src]
Returns a new Loc with given end and current begin
pub fn adjust_begin(&self, delta: i32) -> LocPtr[src]
Adds given delta to begin
pub fn adjust_end(&self, d: i32) -> LocPtr[src]
Adds given delta to end
pub fn resize(&self, new_size: usize) -> LocPtr[src]
Returns a new Loc with the same begin, but adjusted end,
so that its size is equal to given new_size
pub fn join(&self, other: &Self) -> LocPtr[src]
Joins two Locs by choosing min(begin) + max(end)
pub fn is_empty(&self) -> bool[src]
Returns true if Loc is empty (i.e. begin == end)
pub fn source(&self, input: &Input) -> Option<String>[src]
Returns source code of the current Loc on a given Input
impl Loc[src]
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
impl RefUnwindSafe for Loc
impl Send for Loc
impl Sync for Loc
impl Unpin for Loc
impl UnwindSafe for Loc
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> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn clone_into(&self, target: &mut T)[src]
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>,