Skip to main content

Erased

Struct Erased 

Source
pub struct Erased<M>(/* private fields */);
Expand description

Stackable wrapper normalizing only the result type. It forwards identity, actual pixel views and operation controls. Typed callers keep their native result by omitting this wrapper. No Send/Sync bounds are added.

Implementations§

Source§

impl<M> Erased<M>

Source

pub const fn new(inner: M) -> Self

Wrap a typed metric or native prepared reference.

Trait Implementations§

Source§

impl<M: PreparePlanarReference> DynPreparePlanarReference for Erased<M>
where M::Output: 'static,

Source§

fn prepare_planar( &mut self, reference: &PlanarView<'_>, opts: EvalOpts<'_>, ) -> MetricResult<Box<dyn PlanarWarmReference<Output = ErasedEvaluation> + '_>>

Prepare actual owned native work, with fresh per-candidate controls.
Source§

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

Source§

fn prepare( &mut self, r: &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.
Source§

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

Source§

type Output = ErasedEvaluation

Native structured assessment; no mandatory erasure or boxing.
Source§

fn id(&self) -> MetricId

Effective scoring configuration and actual implementation provenance.
Source§

fn evaluate( &mut self, r: &PixelView<'_>, d: &PixelView<'_>, opts: EvalOpts<'_>, ) -> MetricResult<Self::Output>

Native comparison. Poll controls and join owned workers before return. Use score for admission and returned-score checks.
Source§

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

Source§

type Output = ErasedEvaluation

Complete native result, without mandatory boxing.
Source§

fn id(&self) -> MetricId

Effective configuration and actual implementation provenance.
Source§

fn evaluate_image( &mut self, image: &PixelView<'_>, opts: EvalOpts<'_>, ) -> MetricResult<Self::Output>

Score one image; use crate::score_image for checked calls.
Source§

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

Source§

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

Score complete color-described planes, preserving native output.
Source§

impl<P: PlanarWarmReference> PlanarWarmReference for Erased<P>
where P::Output: 'static,

Source§

type Output = ErasedEvaluation

Complete owned native assessment.
Source§

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

Evaluate a candidate using actual prepared reference work.
Source§

fn with_evaluation( &mut self, d: &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.
Source§

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

Source§

type PlanarPrepared = Erased<<M as PreparePlanarReference>::PlanarPrepared>

Actual owned reference work, suitable for storage in an encoder callback.
Source§

fn warm_planar_reference( &mut self, r: &PlanarView<'_>, opts: EvalOpts<'_>, ) -> MetricResult<Self::PlanarPrepared>

Build native reference work. Subsequent calls use fresh controls.
Source§

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

Source§

type Prepared<'a> = Erased<<M as PrepareReference>::Prepared<'a>> where Self: 'a

Retained work may borrow the scorer, but not the input or preparation pulse. Each subsequent evaluation receives fresh controls.
Source§

fn warm_reference( &mut self, r: &PixelView<'_>, opts: EvalOpts<'_>, ) -> MetricResult<Self::Prepared<'_>>

Prepare work preserving cold-result scalar bits.
Source§

impl<P: WarmReference> WarmReference for Erased<P>
where P::Output: 'static,

Source§

type Output = ErasedEvaluation

Same structured result as the corresponding cold scorer.
Source§

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

Score with fresh operation-local controls.

Auto Trait Implementations§

§

impl<M> Freeze for Erased<M>
where M: Freeze,

§

impl<M> RefUnwindSafe for Erased<M>
where M: RefUnwindSafe,

§

impl<M> Send for Erased<M>
where M: Send,

§

impl<M> Sync for Erased<M>
where M: Sync,

§

impl<M> Unpin for Erased<M>
where M: Unpin,

§

impl<M> UnsafeUnpin for Erased<M>
where M: UnsafeUnpin,

§

impl<M> UnwindSafe for Erased<M>
where M: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.