pub struct SourceCode<T, L> {
pub text: T,
pub line_starts: Option<L>,
}Expand description
Represents the source code of a file.
Fields§
§text: TThe text content of the file.
line_starts: Option<L>An optional “line index” for the file, a list of byte offsets for the start of each line in the file.
Trait Implementations§
Source§impl AsSourceCode for SourceCode<&'_ str, &'_ LineIndex>
impl AsSourceCode for SourceCode<&'_ str, &'_ LineIndex>
fn as_source_code(&self) -> Option<SourceCode<&'_ str, &'_ LineIndex>>
Source§impl AsSourceCode for SourceCode<String, LineIndexBuf>
impl AsSourceCode for SourceCode<String, LineIndexBuf>
fn as_source_code(&self) -> Option<SourceCode<&'_ str, &'_ LineIndex>>
Source§impl<T: Clone, L: Clone> Clone for SourceCode<T, L>
impl<T: Clone, L: Clone> Clone for SourceCode<T, L>
Source§fn clone(&self) -> SourceCode<T, L>
fn clone(&self) -> SourceCode<T, L>
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 moreimpl<T: Copy, L: Copy> Copy for SourceCode<T, L>
Auto Trait Implementations§
impl<T, L> Freeze for SourceCode<T, L>
impl<T, L> RefUnwindSafe for SourceCode<T, L>where
T: RefUnwindSafe,
L: RefUnwindSafe,
impl<T, L> Send for SourceCode<T, L>
impl<T, L> Sync for SourceCode<T, L>
impl<T, L> Unpin for SourceCode<T, L>
impl<T, L> UnwindSafe for SourceCode<T, L>where
T: UnwindSafe,
L: UnwindSafe,
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