pub struct Kernel { /* private fields */ }Expand description
The μ-Kernel: deterministic decision engine
Implementations§
Source§impl Kernel
impl Kernel
Sourcepub fn update_schema(
&mut self,
name: impl Into<String>,
schema: Value,
) -> DoDResult<()>
pub fn update_schema( &mut self, name: impl Into<String>, schema: Value, ) -> DoDResult<()>
Update schema (ΔΣ)
Sourcepub fn add_invariant(
&mut self,
name: impl Into<String>,
constraint: impl Into<String>,
) -> DoDResult<()>
pub fn add_invariant( &mut self, name: impl Into<String>, constraint: impl Into<String>, ) -> DoDResult<()>
Add invariant
Sourcepub fn decide(
&mut self,
observations: Vec<Observation>,
tenant_id: &str,
) -> DoDResult<KernelDecision>
pub fn decide( &mut self, observations: Vec<Observation>, tenant_id: &str, ) -> DoDResult<KernelDecision>
Execute decision with timing enforcement
Sourcepub fn verify_determinism(
&self,
original_decision: &KernelDecision,
replay_decision: &KernelDecision,
) -> DoDResult<()>
pub fn verify_determinism( &self, original_decision: &KernelDecision, replay_decision: &KernelDecision, ) -> DoDResult<()>
Verify determinism: replay should produce identical hash
Sourcepub fn execution_history(&self) -> &BTreeMap<String, KernelDecision>
pub fn execution_history(&self) -> &BTreeMap<String, KernelDecision>
Get execution history
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Kernel
impl RefUnwindSafe for Kernel
impl Send for Kernel
impl Sync for Kernel
impl Unpin for Kernel
impl UnwindSafe for Kernel
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