pub struct Loc { /* private fields */ }
Expand description
Locations
A location, consisting of a FileId and a span in this file.
Implementations
sourceimpl Loc
impl Loc
pub fn new(file_id: FileId, span: Span) -> Loc
pub fn span(&self) -> Span
pub fn file_id(&self) -> FileId
pub fn at_end(&self) -> Loc
pub fn at_start(&self) -> Loc
sourcepub fn enclosing(locs: &[&Loc]) -> Loc
pub fn enclosing(locs: &[&Loc]) -> Loc
Creates a location which encloses all the locations in the provided slice, which must not be empty. All locations are expected to be in the same file.
sourcepub fn is_enclosing(&self, other: &Loc) -> bool
pub fn is_enclosing(&self, other: &Loc) -> bool
Returns true if the other location is enclosed by this location.
sourceimpl Loc
impl Loc
pub fn display(&'env self, env: &'env GlobalEnv) -> LocDisplay<'env>
pub fn display_line_only(&'env self, env: &'env GlobalEnv) -> LocDisplay<'env>
Trait Implementations
sourceimpl Ord for Loc
impl Ord for Loc
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Self where
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Self where
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialEq<Loc> for Loc
impl PartialEq<Loc> for Loc
sourceimpl PartialOrd<Loc> for Loc
impl PartialOrd<Loc> for Loc
sourcefn partial_cmp(&self, other: &Loc) -> Option<Ordering>
fn partial_cmp(&self, other: &Loc) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl Eq for Loc
impl StructuralEq for Loc
impl StructuralPartialEq for Loc
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
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<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.