Struct tvix_eval::chunk::SourceSpan
source · struct SourceSpan {
span: Span,
start: usize,
}
Expand description
Represents a source location from which one or more operations were compiled.
The span itself is an index into a codemap::CodeMap, and the structure tracks the number of operations that were yielded from the same span.
At error reporting time, it becomes possible to either just fetch the textual representation of that span from the codemap, or to even re-parse the AST using rnix to create more semantically interesting errors.
Fields§
§span: Span
Span into the codemap::CodeMap.
start: usize
Index of the first operation covered by this span.
Trait Implementations§
source§impl Clone for SourceSpan
impl Clone for SourceSpan
source§fn clone(&self) -> SourceSpan
fn clone(&self) -> SourceSpan
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 Debug for SourceSpan
impl Debug for SourceSpan
source§impl PartialEq for SourceSpan
impl PartialEq for SourceSpan
source§fn eq(&self, other: &SourceSpan) -> bool
fn eq(&self, other: &SourceSpan) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for SourceSpan
Auto Trait Implementations§
impl Freeze for SourceSpan
impl RefUnwindSafe for SourceSpan
impl Send for SourceSpan
impl Sync for SourceSpan
impl Unpin for SourceSpan
impl UnwindSafe for SourceSpan
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more