pub struct SourceFiles { /* private fields */ }Implementations§
Source§impl SourceFiles
impl SourceFiles
pub fn new() -> Self
pub fn add_file(&self, path: PathBuf, text: String) -> Result<u32>
pub fn get_file(&self, file_id: u32) -> Option<SourceFile>
pub fn to_line_col(&self, span: SourceSpan) -> Option<(u32, u32)>
pub fn snippet(&self, span: SourceSpan, context_lines: usize) -> Option<String>
pub fn relative_path( &self, file_id: u32, workspace_root: &Path, ) -> Option<PathBuf>
pub fn file_count(&self) -> usize
pub fn get_all_files(&self) -> Vec<SourceFile>
Source§impl SourceFiles
impl SourceFiles
pub fn get_source_info(&self, span: SourceSpan) -> Option<SourceInfo>
Trait Implementations§
Source§impl Clone for SourceFiles
impl Clone for SourceFiles
Source§fn clone(&self) -> SourceFiles
fn clone(&self) -> SourceFiles
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SourceFiles
impl Debug for SourceFiles
Auto Trait Implementations§
impl Freeze for SourceFiles
impl RefUnwindSafe for SourceFiles
impl Send for SourceFiles
impl Sync for SourceFiles
impl Unpin for SourceFiles
impl UnsafeUnpin for SourceFiles
impl UnwindSafe for SourceFiles
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more