Struct codespan::CodeMap [−][src]
pub struct CodeMap { /* fields omitted */ }
Methods
impl CodeMap
[src]
impl CodeMap
pub fn new() -> CodeMap
[src]
pub fn new() -> CodeMap
Creates an empty CodeMap
.
pub fn add_filemap(&mut self, name: FileName, src: String) -> Arc<FileMap>
[src]
pub fn add_filemap(&mut self, name: FileName, src: String) -> Arc<FileMap>
Adds a filemap to the codemap with the given name and source string
pub fn add_filemap_from_disk<P: Into<PathBuf>>(
&mut self,
name: P
) -> Result<Arc<FileMap>>
[src]
pub fn add_filemap_from_disk<P: Into<PathBuf>>(
&mut self,
name: P
) -> Result<Arc<FileMap>>
Adds a filemap to the codemap with the given name and source string
pub fn find_file(&self, index: ByteIndex) -> Option<&Arc<FileMap>>
[src]
pub fn find_file(&self, index: ByteIndex) -> Option<&Arc<FileMap>>
Looks up the File
that contains the specified byte index.
pub fn update(&mut self, index: ByteIndex, src: String) -> Option<Arc<FileMap>>
[src]
pub fn update(&mut self, index: ByteIndex, src: String) -> Option<Arc<FileMap>>
Trait Implementations
impl Clone for CodeMap
[src]
impl Clone for CodeMap
fn clone(&self) -> CodeMap
[src]
fn clone(&self) -> CodeMap
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl Debug for CodeMap
[src]
impl Debug for CodeMap
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Default for CodeMap
[src]
impl Default for CodeMap