[][src]Struct codemap::CodeMap

pub struct CodeMap { /* fields omitted */ }

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

impl Debug for CodeMap[src]

impl Default for CodeMap[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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.