[−][src]Struct gluon_base::source::CodeMap
Implementations
impl CodeMap
[src]
pub fn new() -> Self
[src]
pub fn add_filemap(&mut self, filename: String, source: String) -> Arc<FileMap>
[src]
pub fn to_usize(&self, pos: BytePos) -> Option<usize>
[src]
pub fn find_file(&self, file: &str) -> Option<&Arc<FileMap>>
[src]
pub fn get(&self, file_id: FileId) -> Option<&Arc<FileMap>>
[src]
pub fn update(&mut self, index: BytePos, src: String) -> Option<Arc<FileMap>>
[src]
Trait Implementations
impl Clone for CodeMap
[src]
impl Debug for CodeMap
[src]
impl Default for CodeMap
[src]
impl<'a> Files<'a> for CodeMap
[src]
type FileId = 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: FileId) -> Option<Self::Name>
[src]
fn source(&self, file_id: FileId) -> Option<&str>
[src]
fn line_index(&self, file_id: FileId, byte_index: usize) -> Option<usize>
[src]
fn line_range(&self, file_id: FileId, line_index: usize) -> Option<Range<usize>>
[src]
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]
Auto Trait Implementations
impl RefUnwindSafe for CodeMap
impl Send for CodeMap
impl Sync for CodeMap
impl Unpin for CodeMap
impl UnwindSafe for CodeMap
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> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
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>,