Skip to main content

SourceEval

Trait SourceEval 

Source
pub trait SourceEval {
    // Required methods
    fn eval_class(&self) -> EvalClass;
    fn evaluate(
        &self,
        ctx: Option<&EvalContext<'_>>,
    ) -> Result<EvaluatedSource, EvalError>;
}
Expand description

The source-evaluation surface.

Each Source variant implements this. The trait is object-safe but typically called through the inherent Source methods below.

Required Methods§

Source

fn eval_class(&self) -> EvalClass

Classify this source for the IR planner per spec §10.7.0. See EvalClass.

Source

fn evaluate( &self, ctx: Option<&EvalContext<'_>>, ) -> Result<EvaluatedSource, EvalError>

Materialize this source.

Literal / IntRange (Static) and ContinuousInterval / Distribution (Distribution) accept ctx = None. Generator / WorkloadParamList (ContextRequired) require Some(ctx) and return EvalError::NeedsContext otherwise.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§