#[non_exhaustive]pub struct SourceLocation {
pub file: Option<PathBuf>,
pub location: Location,
}Expand description
Source location information combining a file path with a Location span.
A point diagnostic (one that only knows a line/column) is a zero-width span with
location.start == location.end (see Location::point).
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.file: Option<PathBuf>§location: LocationImplementations§
Source§impl SourceLocation
impl SourceLocation
Sourcepub fn at_position(file: Option<PathBuf>, position: Position) -> Self
pub fn at_position(file: Option<PathBuf>, position: Position) -> Self
A diagnostic at a single position (line/column) in file.
Sourcepub fn at_location(file: Option<PathBuf>, location: Location) -> Self
pub fn at_location(file: Option<PathBuf>, location: Location) -> Self
A diagnostic spanning location in file.
Trait Implementations§
Source§impl Clone for SourceLocation
impl Clone for SourceLocation
Source§impl Debug for SourceLocation
impl Debug for SourceLocation
Source§impl Display for SourceLocation
impl Display for SourceLocation
Source§impl PartialEq for SourceLocation
impl PartialEq for SourceLocation
impl StructuralPartialEq for SourceLocation
Auto Trait Implementations§
impl Freeze for SourceLocation
impl RefUnwindSafe for SourceLocation
impl Send for SourceLocation
impl Sync for SourceLocation
impl Unpin for SourceLocation
impl UnsafeUnpin for SourceLocation
impl UnwindSafe for SourceLocation
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