pub trait PlanarWarmReference {
type Output: Evaluation;
// Required method
fn evaluate_planar(
&mut self,
candidate: &PlanarView<'_>,
opts: EvalOpts<'_>,
) -> MetricResult<Self::Output>;
// Provided method
fn with_evaluation(
&mut self,
candidate: &PlanarView<'_>,
opts: EvalOpts<'_>,
consumer: &mut dyn FnMut(EvaluationRef<'_>),
) -> MetricResult<()> { ... }
}Expand description
Prepared native planar scoring. Implementors may override lending to let consumers inspect native scratch before it is recycled, avoiding map export. Workers must join before return. After failure, reuse must succeed correctly or refuse explicitly; stale assessments must never be returned.
Required Associated Types§
Sourcetype Output: Evaluation
type Output: Evaluation
Complete owned native assessment.
Required Methods§
Sourcefn evaluate_planar(
&mut self,
candidate: &PlanarView<'_>,
opts: EvalOpts<'_>,
) -> MetricResult<Self::Output>
fn evaluate_planar( &mut self, candidate: &PlanarView<'_>, opts: EvalOpts<'_>, ) -> MetricResult<Self::Output>
Evaluate a candidate using actual prepared reference work.
Provided Methods§
Sourcefn with_evaluation(
&mut self,
candidate: &PlanarView<'_>,
opts: EvalOpts<'_>,
consumer: &mut dyn FnMut(EvaluationRef<'_>),
) -> MetricResult<()>
fn with_evaluation( &mut self, candidate: &PlanarView<'_>, opts: EvalOpts<'_>, consumer: &mut dyn FnMut(EvaluationRef<'_>), ) -> MetricResult<()>
Invoke consumer exactly once on success, while all borrowed native
arrays remain valid. The default borrows an owned result; an override
can lend scratch directly. A failed operation need not invoke it.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".