Struct ruby_prism::Location
source · pub struct Location<'pr> { /* private fields */ }
Expand description
A range in the source file.
Implementations§
source§impl<'pr> Location<'pr>
impl<'pr> Location<'pr>
sourcepub fn join(&self, other: &Location<'pr>) -> Option<Location<'pr>>
pub fn join(&self, other: &Location<'pr>) -> Option<Location<'pr>>
Return a Location starting at self and ending at the end of other. Returns None if both locations did not originate from the same parser, or if self starts after other.
sourcepub fn start_offset(&self) -> usize
pub fn start_offset(&self) -> usize
Return the start offset from the beginning of the parsed source.
sourcepub fn end_offset(&self) -> usize
pub fn end_offset(&self) -> usize
Return the end offset from the beginning of the parsed source.
Trait Implementations§
Auto Trait Implementations§
impl<'pr> RefUnwindSafe for Location<'pr>
impl<'pr> !Send for Location<'pr>
impl<'pr> !Sync for Location<'pr>
impl<'pr> Unpin for Location<'pr>
impl<'pr> UnwindSafe for Location<'pr>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more