Struct litcheck_core::diagnostics::Source
source · pub struct Source<'a> {
pub name: FileName,
pub code: Cow<'a, str>,
}
Fields§
§name: FileName
§code: Cow<'a, str>
Implementations§
Trait Implementations§
source§impl<'s> SourceCode for Source<'s>
impl<'s> SourceCode for Source<'s>
source§fn read_span<'a>(
&'a self,
span: &SourceSpan,
context_lines_before: usize,
context_lines_after: usize
) -> Result<Box<dyn SpanContents<'a> + 'a>, MietteError>
fn read_span<'a>( &'a self, span: &SourceSpan, context_lines_before: usize, context_lines_after: usize ) -> Result<Box<dyn SpanContents<'a> + 'a>, MietteError>
Read the bytes for a specific span from this SourceCode, keeping a
certain number of lines before and after the span as context.
Auto Trait Implementations§
impl<'a> Freeze for Source<'a>
impl<'a> RefUnwindSafe for Source<'a>
impl<'a> Send for Source<'a>
impl<'a> Sync for Source<'a>
impl<'a> Unpin for Source<'a>
impl<'a> UnwindSafe for Source<'a>
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