Skip to main content

Engine

Struct Engine 

Source
pub struct Engine { /* private fields */ }
Expand description

The kernel engine. Cheap to clone (the store and lock map are Arcs; clones share the same per-session locks).

Implementations§

Source§

impl Engine

Source

pub fn new(store: Arc<dyn StateStore>) -> Self

Build an engine over the given store.

Source

pub fn open_session( &self, session_id: &str, coverage_schema: Option<CoverageSchema>, ) -> Result<InterviewState>

session.open (spec §5): start or resume a session. If new, write the SessionOpened event with the supplied (or default) coverage schema. If it already exists, the schema arg is ignored (the original governs) and the current state is returned.

Source

pub fn state(&self, session_id: &str) -> Result<InterviewState>

state.get (spec §5): read-only projection of the session.

Source

pub fn add_claim( &self, session_id: &str, claim: Claim, requirement: Option<RequirementMeta>, ) -> Result<InterviewState>

append variant add_claim (spec §5). Validates the claim, rejects duplicate ids, appends, and returns the recomputed state.

Source

pub fn add_evidence( &self, session_id: &str, evidence: EvidenceEvent, ) -> Result<InterviewState>

append variant add_evidence (spec §5).

Source

pub fn remediate( &self, session_id: &str, remediation: RemediationEvent, ) -> Result<InterviewState>

append variant remediate{...} (spec §5). Validates that every target referenced by the move exists, then appends.

Source

pub fn next_question(&self, session_id: &str) -> Result<Option<Signal>>

question.next (spec §5): the highest-leverage next question, or None.

Source

pub fn readiness(&self, session_id: &str) -> Result<ReadinessReport>

readiness.assess (spec §5 / §6): the readiness report.

Source

pub fn export(&self, session_id: &str) -> Result<SpecDocument>

spec.export (spec §6): the aligned, plan-ready spec document.

Trait Implementations§

Source§

impl Clone for Engine

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.