pub struct MietteSpanContents<'a> { /* private fields */ }
Expand description
Basic implementation of the SpanContents
trait, for convenience.
Implementations§
Source§impl<'a> MietteSpanContents<'a>
impl<'a> MietteSpanContents<'a>
Sourcepub const fn new(
data: &'a [u8],
span: SourceSpan,
line: usize,
column: usize,
line_count: usize,
) -> MietteSpanContents<'a>
pub const fn new( data: &'a [u8], span: SourceSpan, line: usize, column: usize, line_count: usize, ) -> MietteSpanContents<'a>
Make a new MietteSpanContents
object.
Sourcepub const fn new_named(
name: String,
data: &'a [u8],
span: SourceSpan,
line: usize,
column: usize,
line_count: usize,
) -> MietteSpanContents<'a>
pub const fn new_named( name: String, data: &'a [u8], span: SourceSpan, line: usize, column: usize, line_count: usize, ) -> MietteSpanContents<'a>
Make a new MietteSpanContents
object, with a name for its ‘file’.
Sourcepub fn with_language(self, language: impl Into<String>) -> Self
pub fn with_language(self, language: impl Into<String>) -> Self
Sets the language
for syntax highlighting.
Trait Implementations§
Source§impl<'a> Clone for MietteSpanContents<'a>
impl<'a> Clone for MietteSpanContents<'a>
Source§fn clone(&self) -> MietteSpanContents<'a>
fn clone(&self) -> MietteSpanContents<'a>
Returns a copy 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 moreSource§impl<'a> Debug for MietteSpanContents<'a>
impl<'a> Debug for MietteSpanContents<'a>
Source§impl<'a> SpanContents<'a> for MietteSpanContents<'a>
impl<'a> SpanContents<'a> for MietteSpanContents<'a>
Source§fn span(&self) -> &SourceSpan
fn span(&self) -> &SourceSpan
SourceSpan
representing the span covered by this SpanContents
.Source§fn line(&self) -> usize
fn line(&self) -> usize
The 0-indexed line in the associated
SourceCode
where the data
begins.Source§fn column(&self) -> usize
fn column(&self) -> usize
The 0-indexed column in the associated
SourceCode
where the data
begins, relative to line
.Source§fn line_count(&self) -> usize
fn line_count(&self) -> usize
Total number of lines covered by this
SpanContents
.Auto Trait Implementations§
impl<'a> Freeze for MietteSpanContents<'a>
impl<'a> RefUnwindSafe for MietteSpanContents<'a>
impl<'a> Send for MietteSpanContents<'a>
impl<'a> Sync for MietteSpanContents<'a>
impl<'a> Unpin for MietteSpanContents<'a>
impl<'a> UnwindSafe for MietteSpanContents<'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