Struct codespan::FileMap[][src]

pub struct FileMap<S = String> { /* fields omitted */ }

Some source code

Methods

impl<S> FileMap<S> where
    S: AsRef<str>, 
[src]

Construct a new, standalone filemap.

This can be useful for tests that consist of a single source file. Production code should however use CodeMap::add_filemap or CodeMap::add_filemap_from_disk instead.

The name of the file that the source came from

The underlying source code

The span of the source in the CodeMap

Returns the byte offset to the start of line.

Lines may be delimited with either \n or \r\n.

Returns the byte index of the start of line.

Lines may be delimited with either \n or \r\n.

Returns the byte offset to the start of line.

Lines may be delimited with either \n or \r\n.

Returns the line and column location of byte

Returns the line index that the byte index points to

Get the corresponding source string for a span

Returns Err if the span is outside the bounds of the file

Trait Implementations

impl<S: Debug> Debug for FileMap<S>
[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl<S> Send for FileMap<S> where
    S: Send

impl<S> Sync for FileMap<S> where
    S: Sync