Skip to main content

Evaluation

Struct Evaluation 

Source
pub struct Evaluation<'c> { /* private fields */ }
Expand description

An evaluation in progress.

Implementations§

Source§

impl Evaluation<'_>

Source

pub fn pending_acquisitions(&self) -> Vec<PendingAcquisition>

Pending pages in definition step order. Each step has at most one.

Source

pub fn supply_page( &mut self, step: &str, tier_index: u32, page_index: u32, bytes: &[u8], ) -> Result<(), SupplyError>

Parse and validate page bytes against the pending request and bound contract. An invalid page completes the step as invalid_backend_output.

Source

pub fn supply_acquisition_failure( &mut self, step: &str, tier_index: u32, page_index: u32, reason: Unresolved, ) -> Result<(), SupplyError>

Complete a pending acquisition with one of the runtime’s allowed failures.

Source§

impl Evaluation<'_>

Source

pub fn extraction_request(&self, step: &str) -> Option<&ExtractRequest>

The structured request behind a pending extraction request.

Source

pub fn withhold_extraction( &mut self, step: &str, unavailable: bool, withheld_from_exact: &[String], ) -> Result<(), SupplyError>

Runtime reports screening before dispatch. Exact fallback sources remain readable unless named in withheld_from_exact.

Source

pub fn cancel_extraction(&mut self, step: &str) -> Result<(), SupplyError>

Cancellation is a request outcome even though it is not an Unresolved kind.

Source§

impl<'c> Evaluation<'c>

Source

pub fn start( compiled: &'c Compiled, snapshot: &Snapshot, now: Timestamp, ) -> Result<Self, StartError>

Validate snapshot at now and compute every exact step that can be computed. Semantic requests become pending.

Source

pub fn now(&self) -> Timestamp

The evaluation time.

Source

pub fn screening_refused(&self) -> bool

Whether a screening refusal has decided this evaluation. Runtime drivers use this read-only hook to withdraw and cancel remaining work.

Source

pub fn pending(&self) -> Vec<SemanticRequest>

Pending semantic requests, in step order then instance order.

Source

pub fn request_document( &self, step: &str, instance: &[String], target: u32, scope: &ReplayScope, ) -> Result<RequestDoc, RequestIdentityError>

The request identity document of a pending request for one of its targets (spec 004, 3.4): 0 is the bound backend, n the plan’s nth fallback for the step. The one function runtime capture and eval replay both use; a scope is valid by construction.

Source

pub fn supply_doc(&mut self, doc: &BackendOutputDoc) -> Result<(), SupplyError>

Supply a backend output document; its artifact must be the bound one.

Source

pub fn note_failure( &mut self, step: &str, instance: &[String], context: FailureContext, )

Record the backend context of a request the runtime is about to supply as failed (spec 033, 3.9). Only backend_unavailable and invalid_backend_output read it.

Source

pub fn supply( &mut self, step: &str, instance: &[String], s: Supplied, ) -> Result<(), SupplyError>

Supply one request’s result.

Source

pub fn check_output( &self, step: &str, instance: &[String], raw: &RawOutput, ) -> Result<Result<(), Unresolved>, SupplyError>

What supply would record for raw, without consuming the request (spec 003, 3.2.4): Ok(Ok(())) for a valid output, Ok(Err(_)) with the invalid_backend_output it would record, or Err when no such request is pending. A pure read; supply still validates.

Source

pub fn finish( self, decision_id: &str, ) -> Result<(Judgment, EvidenceRecord), NotReady>

Finish: evaluate the policy and build the judgment and evidence.

Source

pub fn begin_generation( self, decision_id: &str, ) -> Result<GenerationEvaluation<'c>, GenerationError>

Freeze the decision and enter the pure generation stage. Its pending requests are separate from decision requests and can never affect policy.

Source

pub fn exact_value(&self, step: &str) -> Option<&Value>

The value of an exact step, if resolved.

Source

pub fn status_of(&self, r: &str) -> Result<(), Unresolved>

The status of an input or step reference (input:x, step:y).

Auto Trait Implementations§

§

impl<'c> Freeze for Evaluation<'c>

§

impl<'c> RefUnwindSafe for Evaluation<'c>

§

impl<'c> Send for Evaluation<'c>

§

impl<'c> Sync for Evaluation<'c>

§

impl<'c> Unpin for Evaluation<'c>

§

impl<'c> UnsafeUnpin for Evaluation<'c>

§

impl<'c> UnwindSafe for Evaluation<'c>

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.