Skip to main content

Runtime

Struct Runtime 

Source
pub struct Runtime { /* private fields */ }

Implementations§

Source§

impl Runtime

Source

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

Source

pub fn builder( clock: Arc<dyn Clock>, sink: Arc<dyn EvidenceSink>, config: RuntimeConfig, ) -> RuntimeBuilder

Source

pub fn gauges(&self) -> Gauges

Source

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).

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn observer_panics(&self) -> u64

Contained progress callback panics across this runtime’s decisions.

Source

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.

Source

pub fn reconcile(&self, attempt_id: &str, observed_units: u64) -> bool

A later observed charge for an attempt whose cost was unknown, applied to the shared ledger (spec 003, 3.5.5). Delivered records are never rewritten.

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.