Struct codespan_preprocessed::PreprocessedFile
source · [−]pub struct PreprocessedFile<Source> { /* private fields */ }Expand description
The codemap of a preprocessed file.
Implementations
sourceimpl<Source> PreprocessedFile<Source> where
Source: AsRef<str>,
impl<Source> PreprocessedFile<Source> where
Source: AsRef<str>,
Trait Implementations
sourceimpl<Source: Debug> Debug for PreprocessedFile<Source>
impl<Source: Debug> Debug for PreprocessedFile<Source>
sourceimpl<'a, S: 'a + AsRef<str>> EasyLocation<'a> for PreprocessedFile<S>
impl<'a, S: 'a + AsRef<str>> EasyLocation<'a> for PreprocessedFile<S>
sourceimpl<'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::Labels in the corresponding source files. Read more
sourcefn 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.
sourcefn 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
sourcefn 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.
sourcefn 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
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