pub struct SourceRange<'tu> { /* private fields */ }
Expand description
A half-open range in a source file.
Implementations§
Source§impl<'tu> SourceRange<'tu>
impl<'tu> SourceRange<'tu>
Sourcepub fn new(
start: SourceLocation<'tu>,
end: SourceLocation<'tu>,
) -> SourceRange<'tu>
pub fn new( start: SourceLocation<'tu>, end: SourceLocation<'tu>, ) -> SourceRange<'tu>
Constructs a new SourceRange
that spans [start
, end
).
Sourcepub fn get_start(&self) -> SourceLocation<'tu>
pub fn get_start(&self) -> SourceLocation<'tu>
Returns the inclusive start of this source range.
Sourcepub fn get_end(&self) -> SourceLocation<'tu>
pub fn get_end(&self) -> SourceLocation<'tu>
Returns the exclusive end of this source range.
Sourcepub fn is_in_main_file(&self) -> bool
pub fn is_in_main_file(&self) -> bool
Returns whether this source range is in the main file of its translation unit.
Sourcepub fn is_in_system_header(&self) -> bool
pub fn is_in_system_header(&self) -> bool
Returns whether this source range is in a system header.
Trait Implementations§
Source§impl<'tu> Clone for SourceRange<'tu>
impl<'tu> Clone for SourceRange<'tu>
Source§fn clone(&self) -> SourceRange<'tu>
fn clone(&self) -> SourceRange<'tu>
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<'tu> Debug for SourceRange<'tu>
impl<'tu> Debug for SourceRange<'tu>
Source§impl<'tu> Hash for SourceRange<'tu>
impl<'tu> Hash for SourceRange<'tu>
Source§impl<'tu> PartialEq for SourceRange<'tu>
impl<'tu> PartialEq for SourceRange<'tu>
impl<'tu> Copy for SourceRange<'tu>
impl<'tu> Eq for SourceRange<'tu>
Auto Trait Implementations§
impl<'tu> Freeze for SourceRange<'tu>
impl<'tu> RefUnwindSafe for SourceRange<'tu>
impl<'tu> !Send for SourceRange<'tu>
impl<'tu> !Sync for SourceRange<'tu>
impl<'tu> Unpin for SourceRange<'tu>
impl<'tu> UnwindSafe for SourceRange<'tu>
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