Struct clang::source::SourceRange
source · [−]pub struct SourceRange<'tu> { /* private fields */ }
Expand description
A half-open range in a source file.
Implementations
sourceimpl<'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
sourceimpl<'tu> Clone for SourceRange<'tu>
impl<'tu> Clone for SourceRange<'tu>
sourcefn clone(&self) -> SourceRange<'tu>
fn clone(&self) -> SourceRange<'tu>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<'tu> Debug for SourceRange<'tu>
impl<'tu> Debug for SourceRange<'tu>
sourceimpl<'tu> Hash for SourceRange<'tu>
impl<'tu> Hash for SourceRange<'tu>
sourceimpl<'tu> PartialEq<SourceRange<'tu>> for SourceRange<'tu>
impl<'tu> PartialEq<SourceRange<'tu>> for SourceRange<'tu>
impl<'tu> Copy for SourceRange<'tu>
impl<'tu> Eq for SourceRange<'tu>
Auto Trait Implementations
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more