pub struct FileLineCol {
pub uri: FileName,
pub line: LineNumber,
pub column: ColumnNumber,
}Expand description
A FileLineCol represents traditional file/line/column information for use in rendering.
Fields§
§uri: FileNameThe path to the source file in which the relevant source code can be found
line: LineNumberThe one-indexed number of the line to which this location refers
column: ColumnNumberThe one-indexed column of the line on which this location starts
Implementations§
Source§impl FileLineCol
impl FileLineCol
Sourcepub fn new(
uri: FileName,
line: impl Into<LineNumber>,
column: impl Into<ColumnNumber>,
) -> Self
pub fn new( uri: FileName, line: impl Into<LineNumber>, column: impl Into<ColumnNumber>, ) -> Self
Creates a new Location.
Sourcepub const fn line(&self) -> LineNumber
pub const fn line(&self) -> LineNumber
Returns the line of the location.
Sourcepub fn move_column(&mut self, offset: i32)
pub fn move_column(&mut self, offset: i32)
Moves the column by the given offset.
Trait Implementations§
Source§impl Clone for FileLineCol
impl Clone for FileLineCol
Source§fn clone(&self) -> FileLineCol
fn clone(&self) -> FileLineCol
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 Debug for FileLineCol
impl Debug for FileLineCol
Source§impl Display for FileLineCol
impl Display for FileLineCol
Source§impl Hash for FileLineCol
impl Hash for FileLineCol
Source§impl Ord for FileLineCol
impl Ord for FileLineCol
Source§fn cmp(&self, other: &FileLineCol) -> Ordering
fn cmp(&self, other: &FileLineCol) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for FileLineCol
impl PartialEq for FileLineCol
Source§impl PartialOrd for FileLineCol
impl PartialOrd for FileLineCol
impl Eq for FileLineCol
impl StructuralPartialEq for FileLineCol
Auto Trait Implementations§
impl Freeze for FileLineCol
impl RefUnwindSafe for FileLineCol
impl Send for FileLineCol
impl Sync for FileLineCol
impl Unpin for FileLineCol
impl UnsafeUnpin for FileLineCol
impl UnwindSafe for FileLineCol
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 moreSource§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
Fallible version of
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
Converts the given value to a
CompactString. Read more