pub struct Evaluation<'c> { /* private fields */ }Expand description
An evaluation in progress.
Implementations§
Source§impl Evaluation<'_>
impl Evaluation<'_>
Sourcepub fn pending_acquisitions(&self) -> Vec<PendingAcquisition>
pub fn pending_acquisitions(&self) -> Vec<PendingAcquisition>
Pending pages in definition step order. Each step has at most one.
Sourcepub fn supply_page(
&mut self,
step: &str,
tier_index: u32,
page_index: u32,
bytes: &[u8],
) -> Result<(), SupplyError>
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.
Sourcepub fn supply_acquisition_failure(
&mut self,
step: &str,
tier_index: u32,
page_index: u32,
reason: Unresolved,
) -> Result<(), SupplyError>
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<'_>
impl Evaluation<'_>
Sourcepub fn extraction_request(&self, step: &str) -> Option<&ExtractRequest>
pub fn extraction_request(&self, step: &str) -> Option<&ExtractRequest>
The structured request behind a pending extraction request.
Sourcepub fn withhold_extraction(
&mut self,
step: &str,
unavailable: bool,
withheld_from_exact: &[String],
) -> Result<(), SupplyError>
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.
Sourcepub fn cancel_extraction(&mut self, step: &str) -> Result<(), SupplyError>
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>
impl<'c> Evaluation<'c>
Sourcepub fn start(
compiled: &'c Compiled,
snapshot: &Snapshot,
now: Timestamp,
) -> Result<Self, StartError>
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.
Sourcepub fn screening_refused(&self) -> bool
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.
Sourcepub fn pending(&self) -> Vec<SemanticRequest>
pub fn pending(&self) -> Vec<SemanticRequest>
Pending semantic requests, in step order then instance order.
Sourcepub fn request_document(
&self,
step: &str,
instance: &[String],
target: u32,
scope: &ReplayScope,
) -> Result<RequestDoc, RequestIdentityError>
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.
Sourcepub fn supply_doc(&mut self, doc: &BackendOutputDoc) -> Result<(), SupplyError>
pub fn supply_doc(&mut self, doc: &BackendOutputDoc) -> Result<(), SupplyError>
Supply a backend output document; its artifact must be the bound one.
Sourcepub fn note_failure(
&mut self,
step: &str,
instance: &[String],
context: FailureContext,
)
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.
Sourcepub fn supply(
&mut self,
step: &str,
instance: &[String],
s: Supplied,
) -> Result<(), SupplyError>
pub fn supply( &mut self, step: &str, instance: &[String], s: Supplied, ) -> Result<(), SupplyError>
Supply one request’s result.
Sourcepub fn check_output(
&self,
step: &str,
instance: &[String],
raw: &RawOutput,
) -> Result<Result<(), Unresolved>, SupplyError>
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.
Sourcepub fn finish(
self,
decision_id: &str,
) -> Result<(Judgment, EvidenceRecord), NotReady>
pub fn finish( self, decision_id: &str, ) -> Result<(Judgment, EvidenceRecord), NotReady>
Finish: evaluate the policy and build the judgment and evidence.
Sourcepub fn begin_generation(
self,
decision_id: &str,
) -> Result<GenerationEvaluation<'c>, GenerationError>
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.
Sourcepub fn exact_value(&self, step: &str) -> Option<&Value>
pub fn exact_value(&self, step: &str) -> Option<&Value>
The value of an exact step, if resolved.