Struct codespan_preprocessed::PreprocessedFile
source · pub struct PreprocessedFile<Source> { /* private fields */ }
Expand description
The codemap of a preprocessed file.
Implementations§
source§impl<Source> PreprocessedFile<Source>where
Source: AsRef<str>,
impl<Source> PreprocessedFile<Source>where Source: AsRef<str>,
Trait Implementations§
source§impl<Source: Debug> Debug for PreprocessedFile<Source>
impl<Source: Debug> Debug for PreprocessedFile<Source>
source§impl<'a, S: 'a + AsRef<str>> EasyLocation<'a> for PreprocessedFile<S>
impl<'a, S: 'a + AsRef<str>> EasyLocation<'a> for PreprocessedFile<S>
source§impl<'a, S: 'a + AsRef<str>> Files<'a> for PreprocessedFile<S>
impl<'a, S: 'a + AsRef<str>> Files<'a> for PreprocessedFile<S>
§type FileId = &'a FileSlice
type FileId = &'a FileSlice
A unique identifier for files in the file provider. This will be used
for rendering
diagnostic::Label
s in the corresponding source files.source§fn name(&'a self, id: Self::FileId) -> Result<Self::Name, Error>
fn name(&'a self, id: Self::FileId) -> Result<Self::Name, Error>
The user-facing name of a file.
source§fn source(&'a self, _: Self::FileId) -> Result<Self::Source, Error>
fn source(&'a self, _: Self::FileId) -> Result<Self::Source, Error>
The source code of a file.
source§fn line_index(
&'a self,
id: Self::FileId,
byte_index: usize
) -> Result<usize, Error>
fn line_index( &'a 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(
&'a self,
id: Self::FileId,
line_index: usize
) -> Result<Range<usize>, Error>
fn line_range( &'a 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<Source> RefUnwindSafe for PreprocessedFile<Source>where Source: RefUnwindSafe,
impl<Source> Send for PreprocessedFile<Source>where Source: Send,
impl<Source> Sync for PreprocessedFile<Source>where Source: Sync,
impl<Source> Unpin for PreprocessedFile<Source>where Source: Unpin,
impl<Source> UnwindSafe for PreprocessedFile<Source>where Source: UnwindSafe,
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