Skip to main content

PlanarWarmReference

Trait PlanarWarmReference 

Source
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§

Source

type Output: Evaluation

Complete owned native assessment.

Required Methods§

Source

fn evaluate_planar( &mut self, candidate: &PlanarView<'_>, opts: EvalOpts<'_>, ) -> MetricResult<Self::Output>

Evaluate a candidate using actual prepared reference work.

Provided Methods§

Source

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".

Implementations on Foreign Types§

Source§

impl<P: PlanarWarmReference + ?Sized> PlanarWarmReference for Box<P>

Source§

type Output = <P as PlanarWarmReference>::Output

Source§

fn evaluate_planar( &mut self, d: &PlanarView<'_>, opts: EvalOpts<'_>, ) -> MetricResult<Self::Output>

Source§

fn with_evaluation( &mut self, d: &PlanarView<'_>, opts: EvalOpts<'_>, consumer: &mut dyn FnMut(EvaluationRef<'_>), ) -> MetricResult<()>

Implementors§