[−][src]Struct gluon_base::source::FileMap
Implementations
impl FileMap
[src]
pub fn new(name: String, source: String) -> Self
[src]
pub fn span(&self) -> Span<BytePos>
[src]
pub fn source(&self) -> &str
[src]
pub fn name(&self) -> &str
[src]
Trait Implementations
impl Debug for FileMap
[src]
impl<'a> Files<'a> for FileMap
[src]
type FileId = ()
A unique identifier for files in the file provider. This will be used for rendering diagnostic::Label
s in the corresponding source files. Read more
type Name = String
The user-facing name of a file, to be displayed in diagnostics.
type Source = &'a str
The source code of a file.
fn name(&self, _file_id: Self::FileId) -> Option<Self::Name>
[src]
fn source(&self, _file_id: Self::FileId) -> Option<&str>
[src]
fn line_index(&self, file_id: Self::FileId, byte_index: usize) -> Option<usize>
[src]
fn line_range(
&self,
file_id: Self::FileId,
line_index: usize
) -> Option<Range<usize>>
[src]
&self,
file_id: Self::FileId,
line_index: usize
) -> Option<Range<usize>>
fn line_number(&'a self, id: Self::FileId, line_index: usize) -> Option<usize>
[src]
fn column_number(
&'a self,
id: Self::FileId,
line_index: usize,
byte_index: usize
) -> Option<usize>
[src]
&'a self,
id: Self::FileId,
line_index: usize,
byte_index: usize
) -> Option<usize>
fn location(&'a self, id: Self::FileId, byte_index: usize) -> Option<Location>
[src]
impl Source for FileMap
[src]
fn new(s: &str) -> Self where
Self: Sized,
[src]
Self: Sized,
fn span(&self) -> Span<BytePos>
[src]
fn src(&self) -> &str
[src]
fn src_slice(&self, span: Span<BytePos>) -> &str
[src]
fn byte_index(&self, line: Line, column: Column) -> Option<BytePos>
[src]
fn line_number_at_byte(&self, pos: BytePos) -> Option<Line>
[src]
fn location(&self, byte: BytePos) -> Option<Location>
[src]
Returns the line and column location of byte
fn comment_start_before(&self, end: BytePos) -> BytePos
[src]
Returns the starting position of any comments and whitespace before end
fn comments_between(&self, span: Span<BytePos>) -> CommentIter<'_>ⓘNotable traits for CommentIter<'a>
impl<'a> Iterator for CommentIter<'a> type Item = &'a str;
[src]
Notable traits for CommentIter<'a>
impl<'a> Iterator for CommentIter<'a> type Item = &'a str;
Auto Trait Implementations
impl RefUnwindSafe for FileMap
impl Send for FileMap
impl Sync for FileMap
impl Unpin for FileMap
impl UnwindSafe for FileMap
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<Id> AsId<Id> for Id where
Id: ?Sized,
[src]
Id: ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,