pub struct Engine<'a, H: Host> { /* private fields */ }Implementations§
Source§impl<'a, H: Host> Engine<'a, H>
impl<'a, H: Host> Engine<'a, H>
Sourcepub fn eval_program(
&mut self,
program: &Program,
env: &mut Env,
) -> Result<Value, Diagnostic>
pub fn eval_program( &mut self, program: &Program, env: &mut Env, ) -> Result<Value, Diagnostic>
Evaluates a program.
Sourcepub fn call_function(
&mut self,
program: &Program,
name: &str,
args: Vec<Value>,
env: &mut Env,
) -> Result<Value, Diagnostic>
pub fn call_function( &mut self, program: &Program, name: &str, args: Vec<Value>, env: &mut Env, ) -> Result<Value, Diagnostic>
Calls a function.
Sourcepub fn call_hook(
&mut self,
program: &Program,
path: &[String],
args: Vec<Value>,
env: &mut Env,
) -> Result<Value, Diagnostic>
pub fn call_hook( &mut self, program: &Program, path: &[String], args: Vec<Value>, env: &mut Env, ) -> Result<Value, Diagnostic>
Dispatch a hook by event path (e.g. ["pulse", "message"] or ["tick"]).
Finds the first on <path>(…) hook in the program whose path matches,
binds the supplied argument values to its parameters, and evaluates its
body. Returns Ok(Value::Null) if no matching hook exists (the host
may choose to ignore unhandled events silently).
Source§impl<'a, H: Host> Engine<'a, H>
impl<'a, H: Host> Engine<'a, H>
Sourcepub fn workspace_left(&self) -> u64
pub fn workspace_left(&self) -> u64
Workspace remaining.
Sourcepub fn new(host: &'a mut H, budget: Budget) -> Self
pub fn new(host: &'a mut H, budget: Budget) -> Self
Creates a new Engine with all built-in vibe-0.03 extension providers registered.
Sourcepub fn with_program(host: &'a mut H, budget: Budget, program: &Program) -> Self
pub fn with_program(host: &'a mut H, budget: Budget, program: &Program) -> Self
Attach a program so eval_call can resolve user-defined functions.
Sourcepub fn with_phase_leaser(
host: &'a mut H,
budget: Budget,
leaser: &'a mut PhaseLeaser,
) -> Self
pub fn with_phase_leaser( host: &'a mut H, budget: Budget, leaser: &'a mut PhaseLeaser, ) -> Self
Attach a deontic phase leaser (R2).
Sourcepub fn with_extension_governance(
host: &'a mut H,
budget: Budget,
registry: ExtensionRegistry<'a>,
call_context: CallExecutionContext,
gate: Option<&'a mut dyn SentinelPolicyGate>,
) -> Self
pub fn with_extension_governance( host: &'a mut H, budget: Budget, registry: ExtensionRegistry<'a>, call_context: CallExecutionContext, gate: Option<&'a mut dyn SentinelPolicyGate>, ) -> Self
Attach an explicit ExtensionRegistry, CallExecutionContext, and optional SentinelPolicyGate (Stage S6).
Sourcepub fn extension_registry(&self) -> &ExtensionRegistry<'a>
pub fn extension_registry(&self) -> &ExtensionRegistry<'a>
Returns a reference to the engine’s ExtensionRegistry.
Sourcepub fn extension_registry_mut(&mut self) -> &mut ExtensionRegistry<'a>
pub fn extension_registry_mut(&mut self) -> &mut ExtensionRegistry<'a>
Returns a mutable reference to the engine’s ExtensionRegistry.
Sourcepub fn set_extension_governance(
&mut self,
call_context: CallExecutionContext,
gate: Option<&'a mut dyn SentinelPolicyGate>,
)
pub fn set_extension_governance( &mut self, call_context: CallExecutionContext, gate: Option<&'a mut dyn SentinelPolicyGate>, )
Configures the CallExecutionContext and optional SentinelPolicyGate.
Sourcepub fn last_extension_outcome(&self) -> Option<&DispatchOutcome>
pub fn last_extension_outcome(&self) -> Option<&DispatchOutcome>
Returns the most recent extension DispatchOutcome (receipt and audit NQuin48s).
Sourcepub fn active_policy_generation(&self) -> Result<u64, VibeTrap>
pub fn active_policy_generation(&self) -> Result<u64, VibeTrap>
Returns the active Sentinel policy generation (or 0 when in standalone developer mode).