pub struct JavascriptExecutionEngine { /* private fields */ }Implementations§
Source§impl JavascriptExecutionEngine
impl JavascriptExecutionEngine
pub fn new(runtime: RuntimeContext) -> Self
Sourcepub fn set_runtime_context(&mut self, runtime: RuntimeContext)
pub fn set_runtime_context(&mut self, runtime: RuntimeContext)
Bind this engine to the process-owned runtime before starting work.
This setter exists for embedders that previously constructed via
Default; new code should prefer Self::new.
pub fn create_context( &mut self, request: CreateJavascriptContextRequest, ) -> JavascriptContext
Sourcepub fn dispose_context(&mut self, context_id: &str) -> bool
pub fn dispose_context(&mut self, context_id: &str) -> bool
Dispose an execution context once its final start/prepare operation has consumed the metadata. Live executions own their resolved runtime state independently and do not consult this registry after creation.
pub fn start_execution( &mut self, request: StartJavascriptExecutionRequest, ) -> Result<JavascriptExecution, JavascriptExecutionError>
pub fn start_execution_with_runtime( &mut self, request: StartJavascriptExecutionRequest, runtime: RuntimeContext, ) -> Result<JavascriptExecution, JavascriptExecutionError>
pub fn prepare_execution( &mut self, request: StartJavascriptExecutionRequest, ) -> Result<JavascriptExecution, JavascriptExecutionError>
Sourcepub fn prepare_execution_with_runtime(
&mut self,
request: StartJavascriptExecutionRequest,
runtime: RuntimeContext,
) -> Result<JavascriptExecution, JavascriptExecutionError>
pub fn prepare_execution_with_runtime( &mut self, request: StartJavascriptExecutionRequest, runtime: RuntimeContext, ) -> Result<JavascriptExecution, JavascriptExecutionError>
Prepare an execution with an explicitly scoped runtime without enqueueing guest code. Cross-runtime exec uses this to bind the replacement isolate to the target VM’s accounting and reactor state before committing execve.
Sourcepub fn start_execution_with_module_reader(
&mut self,
request: StartJavascriptExecutionRequest,
module_reader: Option<Box<dyn ModuleFsReader + Send>>,
guest_reader: Option<Box<dyn GuestModuleReader>>,
) -> Result<JavascriptExecution, JavascriptExecutionError>
pub fn start_execution_with_module_reader( &mut self, request: StartJavascriptExecutionRequest, module_reader: Option<Box<dyn ModuleFsReader + Send>>, guest_reader: Option<Box<dyn GuestModuleReader>>, ) -> Result<JavascriptExecution, JavascriptExecutionError>
Like start_execution but with an optional
read-only VFS reader over the mounted node_modules tree. When supplied,
the bridge thread resolves module-resolution RPCs inline against this
reader (off the service loop, concurrently with it) instead of routing
them through the service loop. The reader must be Send because it is
moved onto the bridge thread; it must read the same mount the guest sees.
Sourcepub fn prepare_execution_with_module_reader(
&mut self,
request: StartJavascriptExecutionRequest,
module_reader: Option<Box<dyn ModuleFsReader + Send>>,
guest_reader: Option<Box<dyn GuestModuleReader>>,
) -> Result<JavascriptExecution, JavascriptExecutionError>
pub fn prepare_execution_with_module_reader( &mut self, request: StartJavascriptExecutionRequest, module_reader: Option<Box<dyn ModuleFsReader + Send>>, guest_reader: Option<Box<dyn GuestModuleReader>>, ) -> Result<JavascriptExecution, JavascriptExecutionError>
Prepare an execution through every fallible image-loading step without enqueueing guest code in V8. Used by execve when the replacement runtime differs from the current runtime.