pub struct Span<'a> {
pub file: &'a str,
pub source: &'a str,
pub offset: usize,
pub text: &'a str,
}Expand description
A fragment of a template that remembers where it was cut from.
Expressions are parsed out of @if(...) and {{ ... }} long after the
lexer has moved on; carrying the origin along is what lets an error inside
one still name the file, line, and column the author typed it at.
Fields§
§file: &'a strThe view name, used as the file in error messages.
source: &'a strThe full template source, needed to count lines.
offset: usizeWhere text starts inside source.
text: &'a strThe fragment itself.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Span<'a>
impl<'a> RefUnwindSafe for Span<'a>
impl<'a> Send for Span<'a>
impl<'a> Sync for Span<'a>
impl<'a> Unpin for Span<'a>
impl<'a> UnsafeUnpin for Span<'a>
impl<'a> UnwindSafe for Span<'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