[−][src]Struct codemap::CodeMap
A data structure recording source code files for position lookup.
Methods
impl CodeMap
[src]
pub fn new() -> CodeMap
[src]
Creates an empty CodeMap
.
pub fn add_file(&mut self, name: String, source: String) -> Arc<File>
[src]
Adds a file with the given name and contents.
Use the returned File
and its .span
property to create Spans
representing substrings of the file.
pub fn find_file(&self, pos: Pos) -> &Arc<File>
[src]
Looks up the File
that contains the specified position.
pub fn look_up_pos(&self, pos: Pos) -> Loc
[src]
Gets the file, line, and column represented by a Pos
.
pub fn look_up_span(&self, span: Span) -> SpanLoc
[src]
Gets the file and its line and column ranges represented by a Span
.
Trait Implementations
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<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>,