pub struct SourceCode<'src> {
pub path: &'src str,
pub text: &'src str,
pub index: LineIndex,
}Fields§
§path: &'src str§text: &'src str§index: LineIndexImplementations§
Source§impl<'src> SourceCode<'src>
impl<'src> SourceCode<'src>
pub fn new(path: &'src str, text: &'src str) -> Self
pub fn line_index(&self, offset: TextSize) -> LineNumber
pub fn source_location(&self, offset: TextSize) -> SourceLocation
pub fn get_range(&'src self, range: TextRange) -> &'src str
Trait Implementations§
Source§impl<'src> Clone for SourceCode<'src>
impl<'src> Clone for SourceCode<'src>
Source§fn clone(&self) -> SourceCode<'src>
fn clone(&self) -> SourceCode<'src>
Returns a duplicate of the value. Read more
1.0.0 · 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<'src> Freeze for SourceCode<'src>
impl<'src> RefUnwindSafe for SourceCode<'src>
impl<'src> Send for SourceCode<'src>
impl<'src> Sync for SourceCode<'src>
impl<'src> Unpin for SourceCode<'src>
impl<'src> UnsafeUnpin for SourceCode<'src>
impl<'src> UnwindSafe for SourceCode<'src>
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