Skip to main content

ErasedEvaluation

Struct ErasedEvaluation 

Source
pub struct ErasedEvaluation { /* private fields */ }
Expand description

An owned native assessment with common borrowed score access. The native result is moved into a box; scalar descriptors and diagnostic arrays are not copied. Score iteration uses a short-lived erased iterator allocation.

Implementations§

Source§

impl ErasedEvaluation

Source

pub fn new<T: Evaluation + 'static>(native: T) -> Self

Erase an assessment. Repeated erasure preserves the original native downcast target rather than retaining nested erased-result envelopes.

Source

pub fn native<T: 'static>(&self) -> Option<&T>

Borrow the original concrete assessment, including any explicitly requested native diagnostic data. Returns None for a different type.

Trait Implementations§

Source§

impl Evaluation for ErasedEvaluation

Source§

fn visit_scores<'a>(&'a self, visitor: &mut dyn FnMut(Score<'a>))

Visit scores without allocating an erased iterator. Implementations overriding this method must expose exactly the same order and values.
Source§

fn visit_maps<'a>(&'a self, visitor: &mut dyn FnMut(MapView<'a>))

Visit maps without allocating an erased iterator, with the same views and order as Self::maps.
Source§

fn scores(&self) -> impl Iterator<Item = Score<'_>>

All scalar outputs and their semantics, headline first when applicable.
Source§

fn maps(&self) -> impl Iterator<Item = MapView<'_>>

Borrow native map planes when diagnostics were requested. The default publishes none; a metric without diagnostics must refuse a request. Native fields remain accessible even when no common map view is exposed.

Auto Trait Implementations§

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.