pub struct RulesBackend { /* private fields */ }Expand description
A validated rules program, ready to answer requests.
Implementations§
Source§impl RulesBackend
impl RulesBackend
Sourcepub fn check_plan(&self, plan: &Plan) -> Result<(), Vec<PlanMismatch>>
pub fn check_plan(&self, plan: &Plan) -> Result<(), Vec<PlanMismatch>>
Check every semantic step plan binds to this backend, as primary or
runtime fallback target. Returns every mismatch; an empty plan use is
not an error.
Source§impl RulesBackend
impl RulesBackend
Sourcepub fn new(program: RulesProgram) -> Result<Self, ProgramError>
pub fn new(program: RulesProgram) -> Result<Self, ProgramError>
Validate program and derive the descriptor and artifact identity
(spec 005, 3.3, 3.9 and 3.10). The program is the only input: there
is no other behavior-affecting configuration.
Sourcepub fn from_bytes(bytes: &[u8]) -> Result<Self, ProgramError>
pub fn from_bytes(bytes: &[u8]) -> Result<Self, ProgramError>
Parse and validate program bytes supplied by the host.
Sourcepub fn program(&self) -> &RulesProgram
pub fn program(&self) -> &RulesProgram
The program, including each task’s authored interpretation (3.8).
Sourcepub fn artifact(&self) -> &ArtifactId
pub fn artifact(&self) -> &ArtifactId
The artifact identity: the program’s digest.
Sourcepub fn evaluate(&self, projection: &[u8], cancel: &CancelSignal) -> Evaluated
pub fn evaluate(&self, projection: &[u8], cancel: &CancelSignal) -> Evaluated
Answer one canonical projection synchronously, observing cancel at
the points of spec 005 3.13.1. Usable without any runtime.
Trait Implementations§
Source§impl Clone for RulesBackend
impl Clone for RulesBackend
Source§impl Debug for RulesBackend
impl Debug for RulesBackend
Source§impl DecisionBackend for RulesBackend
impl DecisionBackend for RulesBackend
Source§fn cost_model(&self) -> CostModel
fn cost_model(&self) -> CostModel
Every call is bounded by the program’s units_per_call (3.12).
fn descriptor(&self) -> &BackendDescriptor
Source§fn cost_bound(&self, _projection: &[u8]) -> CostBound
fn cost_bound(&self, _projection: &[u8]) -> CostBound
Per-call disclosure before dispatch. A
bounded model returns
bounded; fractional costs are rounded up.fn infer<'a>(&'a self, call: AttemptCall<'a>) -> BoxFuture<'a, AttemptReport>
Source§fn batch_capability(&self, _projection: &[u8]) -> Option<BatchCapability>
fn batch_capability(&self, _projection: &[u8]) -> Option<BatchCapability>
Opt-in general batch declaration.
None preserves unbatched behavior.Source§fn take_remote_evidence(&self, _attempt_id: &str) -> Option<RemoteEvidence>
fn take_remote_evidence(&self, _attempt_id: &str) -> Option<RemoteEvidence>
The remote evidence of an attempt this backend ran, for a
rustev.run/2 record (spec 020, 3.2), taken once: the adapter’s
part of the entry (exchange reference, identities, binding, code,
charge provenance); the runtime sets the step, instance and final
remote state. None, the default, for an in-process backend.Source§fn infer_batch<'a>(
&'a self,
_call: BatchAttemptCall,
) -> Pin<Box<dyn Future<Output = BatchAttemptReport> + Send + 'a>>
fn infer_batch<'a>( &'a self, _call: BatchAttemptCall, ) -> Pin<Box<dyn Future<Output = BatchAttemptReport> + Send + 'a>>
Dispatch a declared-compatible batch. The default is unreachable for
a backend that keeps the default
batch_capability implementation.Auto Trait Implementations§
impl Freeze for RulesBackend
impl RefUnwindSafe for RulesBackend
impl Send for RulesBackend
impl Sync for RulesBackend
impl Unpin for RulesBackend
impl UnsafeUnpin for RulesBackend
impl UnwindSafe for RulesBackend
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more