pub struct SourceFile {
pub id: SourceId,
pub name: String,
pub text: String,
/* private fields */
}Fields§
§id: SourceId§name: String§text: StringImplementations§
Source§impl SourceFile
impl SourceFile
pub fn line_count(&self) -> usize
pub fn line_col_for_offset(&self, offset: usize) -> Option<(usize, usize)>
pub fn line_span(&self, line: usize) -> Option<Range<usize>>
pub fn line_text(&self, line: usize) -> Option<&str>
pub fn line_col_to_offset(&self, line: usize, col: usize) -> Option<usize>
Trait Implementations§
Source§impl Clone for SourceFile
impl Clone for SourceFile
Source§fn clone(&self) -> SourceFile
fn clone(&self) -> SourceFile
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 moreAuto 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