pub struct NativeEngine<'m, 'h, H: Host> { /* private fields */ }Expand description
The native semantic engine over a verified program.
'm bounds the module and entry table; 'h bounds the host borrow. The
embedded Machine owns the shared heap/globals/host/limits and every
value-semantic method; the engine never calls Machine::run. All mutable
state is behind RefCell/Cell because NativeOps dispatches on
&self (see the module docs on re-entrancy).
Implementations§
Source§impl<'m, 'h, H: Host> NativeEngine<'m, 'h, H>
impl<'m, 'h, H: Host> NativeEngine<'m, 'h, H>
Sourcepub fn new(
program: &'m Program<Verified>,
entries: &'m dyn NativeEntryTable,
host: &'h mut H,
limits: Limits,
) -> Selfwhere
'm: 'h,
pub fn new(
program: &'m Program<Verified>,
entries: &'m dyn NativeEntryTable,
host: &'h mut H,
limits: Limits,
) -> Selfwhere
'm: 'h,
A native engine that drives control flow itself (the compiler-free
reference backend). entries is used only for nested calls under the
linked backend; the reference backend recurses internally.
Sourcepub fn run(self) -> Result<Execution, RuntimeError>
pub fn run(self) -> Result<Execution, RuntimeError>
Executes the program entry with the reference driver. Never invokes
Machine::run.
Trait Implementations§
Source§impl<'m, 'h, H: Host> NativeOps for NativeEngine<'m, 'h, H>
impl<'m, 'h, H: Host> NativeOps for NativeEngine<'m, 'h, H>
Source§fn truthy(&self, _frame: &mut NativeFrame<'_>, value: Value) -> bool
fn truthy(&self, _frame: &mut NativeFrame<'_>, value: Value) -> bool
The total ToBoolean coercion. Never throws.
Source§fn dispatch(
&self,
frame: &mut NativeFrame<'_>,
call: HelperCall,
) -> HelperResult
fn dispatch( &self, frame: &mut NativeFrame<'_>, call: HelperCall, ) -> HelperResult
Executes one completion helper, writing any register side effects through
frame and returning the completion.Auto Trait Implementations§
impl<'m, 'h, H> !Freeze for NativeEngine<'m, 'h, H>
impl<'m, 'h, H> !RefUnwindSafe for NativeEngine<'m, 'h, H>
impl<'m, 'h, H> !Send for NativeEngine<'m, 'h, H>
impl<'m, 'h, H> !Sync for NativeEngine<'m, 'h, H>
impl<'m, 'h, H> !UnwindSafe for NativeEngine<'m, 'h, H>
impl<'m, 'h, H> Unpin for NativeEngine<'m, 'h, H>
impl<'m, 'h, H> UnsafeUnpin for NativeEngine<'m, 'h, H>
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