Skip to main content

DynPrepareReference

Trait DynPrepareReference 

Source
pub trait DynPrepareReference: Metric<Output = ErasedEvaluation> {
    // Required method
    fn prepare(
        &mut self,
        reference: &PixelView<'_>,
        opts: EvalOpts<'_>,
    ) -> MetricResult<Box<dyn WarmReference<Output = ErasedEvaluation> + '_>>;
}
Expand description

Object-safe optional preparation. Only metrics with native prepared work implement this extension; a cold metric is not given a replay fallback.

Required Methods§

Source

fn prepare( &mut self, reference: &PixelView<'_>, opts: EvalOpts<'_>, ) -> MetricResult<Box<dyn WarmReference<Output = ErasedEvaluation> + '_>>

Prepare checked reference work. Returned objects retain dimensions and use fresh candidate controls, without retaining the preparation pulse.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl<M: PrepareReference> DynPrepareReference for Erased<M>
where M::Output: 'static,