Skip to main content

EvaluationControl

Struct EvaluationControl 

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

The run evidence used to classify cooperative evaluator interruption.

This is passed explicitly through checker classification helpers. Its opaque identity prevents another driver’s interruption becoming this run’s stop.

Implementations§

Source§

impl EvaluationControl

Source

pub fn new( budget: &Budget, phase: Phase, ) -> Result<Arc<Self>, HostControlConflict>

Makes an explicit context from the already armed budget and actual phase.

§Errors

The native identity representation is exhausted.

Source

pub fn enter( self: &Arc<Self>, evaluator: &Evaluator, ) -> Result<HostControlScope, HostControlConflict>

Installs this phase’s context for evaluator loop checkpoints. Unlimited and unarmed budgets install a no-op owner scope, so another driver cannot replace control while this evaluator is in use.

§Errors

Another driver owns the evaluator’s control registration.

Source

pub fn verdict(&self, error: &EvalError) -> Option<Verdict>

Matches this context’s interruption to actual exhaustion or measurement failure. A genuine evaluation error or another owner’s interruption returns None.

Source

pub fn owns(&self, error: &EvalError) -> bool

Whether this typed interruption belongs to the same armed run. Identity alone is not proof that a resource was exhausted.

Trait Implementations§

Source§

impl Debug for EvaluationControl

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl HostControl for EvaluationControl

Source§

fn check(&self) -> Result<(), Interrupted>

Checks whether evaluation must return to its driver. Read more

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> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.