pub struct TraceSegment {
pub span: SourceSpan,
pub id: TraceSegmentId,
pub name: Identifier,
pub size: usize,
pub bindings: Vec<TraceBinding>,
pub boundary_constrained: Vec<Span<ColumnBoundaryFlags>>,
}Fields§
§span: SourceSpan§id: TraceSegmentIdThe index of this segment in the trace_columns declaration
name: IdentifierThe name of this trace segment, e.g. $main
NOTE: The name of a trace segment is always a special identifier (i.e. has the $ prefix)
size: usizeThe number of columns in this trace segment
bindings: Vec<TraceBinding>Bindings declared in this segment, without the segment-wide binding, e.g. $main
boundary_constrained: Vec<Span<ColumnBoundaryFlags>>A vector of size elements which tracks for every column whether a
constraint has been applied to that column, and on what boundaries.
Implementations§
Source§impl TraceSegment
impl TraceSegment
Sourcepub fn new(
span: SourceSpan,
id: TraceSegmentId,
name: Identifier,
raw_bindings: Vec<Span<(Identifier, usize)>>,
) -> Self
pub fn new( span: SourceSpan, id: TraceSegmentId, name: Identifier, raw_bindings: Vec<Span<(Identifier, usize)>>, ) -> Self
Constructs a new TraceSegment given a span, segment id, name, and a vector of (Identifier, size) pairs.
Sourcepub fn is_boundary_constrained(
&self,
column: TraceColumnIndex,
boundary: Boundary,
) -> bool
pub fn is_boundary_constrained( &self, column: TraceColumnIndex, boundary: Boundary, ) -> bool
Returns true if column is constrained on boundary
Sourcepub fn mark_constrained(
&mut self,
span: SourceSpan,
column: TraceColumnIndex,
boundary: Boundary,
) -> Option<SourceSpan>
pub fn mark_constrained( &mut self, span: SourceSpan, column: TraceColumnIndex, boundary: Boundary, ) -> Option<SourceSpan>
Marks column as constrained on boundary, and associates it with a span
that is responsible for the constraint.
Returns None if the column was previously unconstrained on boundary,
otherwise it returns the span responsible for the previous constraint for
use in diagnostics
pub fn is_empty(&self) -> bool
Trait Implementations§
Source§impl Clone for TraceSegment
impl Clone for TraceSegment
Source§fn clone(&self) -> TraceSegment
fn clone(&self) -> TraceSegment
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TraceSegment
impl Debug for TraceSegment
Source§impl Display for TraceSegment
impl Display for TraceSegment
Source§impl PartialEq for TraceSegment
impl PartialEq for TraceSegment
Source§impl Spanned for TraceSegment
impl Spanned for TraceSegment
fn span(&self) -> SourceSpan
impl Eq for TraceSegment
Auto Trait Implementations§
impl Freeze for TraceSegment
impl RefUnwindSafe for TraceSegment
impl Send for TraceSegment
impl Sync for TraceSegment
impl Unpin for TraceSegment
impl UnwindSafe for TraceSegment
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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>
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>
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