pub struct EvaluationContext<S = Scoped> { /* private fields */ }Expand description
Inputs for one pin’s evaluation, lifted to a type-state pipeline so
half-built contexts cannot reach the evaluator. The progression is
Pinned (identity) → Scoped (added module/record scope) → Sourced
(added file bytes for context-drift checks). Only Scoped and
Sourced contexts can be evaluated; the EvaluationInput trait lets
the evaluator accept either. Per-state data is stored in the marker
(extras), so there are no Option fields and no runtime expects.
source_snapshot is optional regardless of state: it carries the
matching snapshot at the source pin (the version the patch was
authored against), enabling spec and record-field diffs that flag
signature narrowing between source and target.
Implementations§
Source§impl EvaluationContext<Scoped>
impl EvaluationContext<Scoped>
Sourcepub fn new(
pin: Pin,
snapshot: impl Into<Arc<Snapshot<Canonical>>>,
scope: PinScope,
) -> Self
pub fn new( pin: Pin, snapshot: impl Into<Arc<Snapshot<Canonical>>>, scope: PinScope, ) -> Self
Shortcut for EvaluationContext::for_pin(pin, snap).with_scope(scope).
pub fn with_files(self, files: EvaluationFiles) -> EvaluationContext<Sourced>
Source§impl<S> EvaluationContext<S>
impl<S> EvaluationContext<S>
pub fn with_source_snapshot( self, source: impl Into<Arc<Snapshot<Canonical>>>, ) -> Self
Sourcepub fn with_family_defaults(self, defaults: FamilyDefaults) -> Self
pub fn with_family_defaults(self, defaults: FamilyDefaults) -> Self
Attach the pin’s project-family declarations. Contexts without this skip the versioned-machine and wire-constant checks.
Trait Implementations§
Source§impl<S: Clone> Clone for EvaluationContext<S>
impl<S: Clone> Clone for EvaluationContext<S>
Source§fn clone(&self) -> EvaluationContext<S>
fn clone(&self) -> EvaluationContext<S>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more