pub struct Runtime { /* private fields */ }Implementations§
Source§impl Runtime
impl Runtime
Sourcepub async fn reexecute_live(
&self,
plan: &PreparedPlan,
req: LiveRequest,
authorizer: &dyn LiveAuthorizer,
cancel: &CancelSignal,
) -> Result<LiveResult, LiveRefusal>
pub async fn reexecute_live( &self, plan: &PreparedPlan, req: LiveRequest, authorizer: &dyn LiveAuthorizer, cancel: &CancelSignal, ) -> Result<LiveResult, LiveRefusal>
Re-execute a decision shape live (spec 026): a new decision, under
fresh bounds, with the host authorizing every external attempt
immediately before it is sent. The only entry point that accepts an
authorizer; decide, capture, replay and comparison never dispatch
on its behalf.
Refused before admission, with nothing presented or spent: a reused
historical decision id, a snapshot whose computed identity is not the
stated one, an invalid capture configuration, a plan whose proposals
exceed the document bound, and every admission refusal of decide.
let cancel = rustev_core::seams::CancelSignal::new();
let _ = rt.reexecute_live(plan, live, a, &cancel).await;
let _ = rt.decide(plan, req, &cancel).await;// `decide` takes no authorizer: only `reexecute_live` does.
rt.decide(plan, req, &rustev_core::seams::CancelSignal::new(), a).await;// Nor does capture.
rt.decide_with_capture(plan, req, &rustev_core::seams::CancelSignal::new(), c, a).await;Source§impl Runtime
impl Runtime
pub fn builder( clock: Arc<dyn Clock>, sink: Arc<dyn EvidenceSink>, config: RuntimeConfig, ) -> RuntimeBuilder
pub fn gauges(&self) -> Gauges
Sourcepub fn prepare(&self, compiled: Compiled) -> Result<PreparedPlan, PrepareError>
pub fn prepare(&self, compiled: Compiled) -> Result<PreparedPlan, PrepareError>
Check a compiled plan against the registered backends (spec 003, 3.5.3 and 3.6.5).
Sourcepub fn invalidate_plan(&self, plan: &PreparedPlan) -> Option<InvalidationResult>
pub fn invalidate_plan(&self, plan: &PreparedPlan) -> Option<InvalidationResult>
Invalidate every reusable result in this plan’s namespace, for any correction, revocation, erasure, artifact withdrawal or policy change the host observed. The generation advances before entries are removed, so a result captured earlier is never stored or served.
Sourcepub fn invalidate_scope(
&self,
plan: &PreparedPlan,
principal_handle: &[u8],
) -> Option<InvalidationResult>
pub fn invalidate_scope( &self, plan: &PreparedPlan, principal_handle: &[u8], ) -> Option<InvalidationResult>
Invalidate reusable results for one opaque authorized scope, as for an erasure or a scope revocation.
Sourcepub async fn decide(
&self,
plan: &PreparedPlan,
req: DecisionRequest,
cancel: &CancelSignal,
) -> Result<Decided, DecideError>
pub async fn decide( &self, plan: &PreparedPlan, req: DecisionRequest, cancel: &CancelSignal, ) -> Result<Decided, DecideError>
Run one decision (spec 003). cancel is the caller’s cancellation.
Sourcepub async fn decide_observed(
&self,
plan: &PreparedPlan,
req: DecisionRequest,
cancel: &CancelSignal,
observer: &dyn ProgressObserver,
) -> Result<Decided, DecideError>
pub async fn decide_observed( &self, plan: &PreparedPlan, req: DecisionRequest, cancel: &CancelSignal, observer: &dyn ProgressObserver, ) -> Result<Decided, DecideError>
Run with a value-free observer. The ordinary entry point has no callbacks.
Sourcepub fn observer_panics(&self) -> u64
pub fn observer_panics(&self) -> u64
Contained progress callback panics across this runtime’s decisions.
Sourcepub async fn decide_with_capture(
&self,
plan: &PreparedPlan,
req: DecisionRequest,
cancel: &CancelSignal,
capture: &CaptureConfig,
) -> Result<CapturedDecision, CaptureConfigError>
pub async fn decide_with_capture( &self, plan: &PreparedPlan, req: DecisionRequest, cancel: &CancelSignal, capture: &CaptureConfig, ) -> Result<CapturedDecision, CaptureConfigError>
Runtime::decide with opt-in bounded capture of every supplied
value (spec 004, 5.3). An invalid configuration is refused before
admission. Dropping the future returns nothing, as for decide.