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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)