pub struct SrcRefInner {
pub range: Range<usize>,
pub at: LineCol,
pub source_file_hash: u64,
}Expand description
A reference into the source code
Fields§
§range: Range<usize>Range in bytes
at: LineColLine and column
source_file_hash: u64Hash of the source code file to map SrcRef -> SourceFile
Implementations§
Source§impl SrcRefInner
impl SrcRefInner
Sourcepub fn is_overlapping(&self, other: &Self) -> bool
pub fn is_overlapping(&self, other: &Self) -> bool
Check if two source refs are overlapping.
Sourcepub fn with_line_offset(&self, line_offset: usize) -> Self
pub fn with_line_offset(&self, line_offset: usize) -> Self
Return a reference with a given line offset.
Trait Implementations§
Source§impl Clone for SrcRefInner
impl Clone for SrcRefInner
Source§fn clone(&self) -> SrcRefInner
fn clone(&self) -> SrcRefInner
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for SrcRefInner
impl Default for SrcRefInner
Source§fn default() -> SrcRefInner
fn default() -> SrcRefInner
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SrcRefInner
impl RefUnwindSafe for SrcRefInner
impl Send for SrcRefInner
impl Sync for SrcRefInner
impl Unpin for SrcRefInner
impl UnwindSafe for SrcRefInner
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more