Struct codespan::CodeMap [−][src]
pub struct CodeMap { /* fields omitted */ }Methods
impl CodeMap[src]
impl CodeMappub fn new() -> CodeMap[src]
pub fn new() -> CodeMapCreates 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 CodeMapfn clone(&self) -> CodeMap[src]
fn clone(&self) -> CodeMapReturns 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 CodeMapfn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl Default for CodeMap[src]
impl Default for CodeMap