pub struct SourceFile { /* private fields */ }Expand description
One source file: its display name and its text.
Implementations§
Source§impl SourceFile
impl SourceFile
Sourcepub fn name(&self) -> &str
pub fn name(&self) -> &str
The name shown in diagnostics, usually a path relative to the working directory.
Sourcepub fn line_index(&self, offset: u32) -> usize
pub fn line_index(&self, offset: u32) -> usize
The zero-based index of the line containing offset.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SourceFile
impl RefUnwindSafe for SourceFile
impl Send for SourceFile
impl Sync for SourceFile
impl Unpin for SourceFile
impl UnsafeUnpin for SourceFile
impl UnwindSafe for SourceFile
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