pub struct SourceMap { /* private fields */ }
Available on crate feature
source-tracking
only.Expand description
Implementations§
Trait Implementations§
Source§impl<'f> Files<'f> for SourceMap
Available on crate feature reporting
only.
impl<'f> Files<'f> for SourceMap
Available on crate feature
reporting
only.Source§type FileId = SourceId
type FileId = SourceId
A unique identifier for files in the file provider. This will be used
for rendering
diagnostic::Label
s in the corresponding source files.Source§type Source = ImmutableString
type Source = ImmutableString
The source code of a file.
Source§fn name(&'f self, id: Self::FileId) -> Result<Self::Name, Error>
fn name(&'f self, id: Self::FileId) -> Result<Self::Name, Error>
The user-facing name of a file.
Source§fn source(&'f self, id: Self::FileId) -> Result<Self::Source, Error>
fn source(&'f self, id: Self::FileId) -> Result<Self::Source, Error>
The source code of a file.
Source§fn line_index(
&'f self,
id: Self::FileId,
byte_index: usize,
) -> Result<usize, Error>
fn line_index( &'f self, id: Self::FileId, byte_index: usize, ) -> Result<usize, Error>
The index of the line at the given byte index.
If the byte index is past the end of the file, returns the maximum line index in the file.
This means that this function only fails if the file is not present. Read more
Source§fn line_range(
&'f self,
id: Self::FileId,
line_index: usize,
) -> Result<Range<usize>, Error>
fn line_range( &'f self, id: Self::FileId, line_index: usize, ) -> Result<Range<usize>, Error>
The byte range of line in the source of the file.
Source§fn line_number(
&'a self,
id: Self::FileId,
line_index: usize,
) -> Result<usize, Error>
fn line_number( &'a self, id: Self::FileId, line_index: usize, ) -> Result<usize, Error>
The user-facing line number at the given line index.
It is not necessarily checked that the specified line index
is actually in the file. Read more
Auto Trait Implementations§
impl Freeze for SourceMap
impl !RefUnwindSafe for SourceMap
impl Send for SourceMap
impl Sync for SourceMap
impl Unpin for SourceMap
impl !UnwindSafe for SourceMap
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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 more