pub struct JavascriptExecution { /* private fields */ }Implementations§
Source§impl JavascriptExecution
impl JavascriptExecution
pub fn execution_id(&self) -> &str
pub fn child_pid(&self) -> u32
pub fn v8_session_handle(&self) -> V8SessionHandle
pub fn has_exited(&self) -> bool
Sourcepub fn execute_retained(
&mut self,
user_code: String,
file_path: String,
module: bool,
) -> Result<(), JavascriptExecutionError>
pub fn execute_retained( &mut self, user_code: String, file_path: String, module: bool, ) -> Result<(), JavascriptExecutionError>
Run another sidecar-managed operation in this execution’s retained V8 context. Public clients submit semantic language requests; only the sidecar calls this executor primitive.
Sourcepub fn start_prepared(&mut self) -> Result<(), JavascriptExecutionError>
pub fn start_prepared(&mut self) -> Result<(), JavascriptExecutionError>
Enqueue a replacement image that was fully prepared without running guest code. This is the final step of an atomic cross-runtime execve and must only be called after the kernel and sidecar process state commit.
pub fn write_stdin( &mut self, chunk: &[u8], ) -> Result<(), JavascriptExecutionError>
pub fn close_stdin(&mut self) -> Result<(), JavascriptExecutionError>
pub fn read_kernel_stdin_sync_rpc( &self, request: &JavascriptSyncRpcRequest, ) -> Result<Value, JavascriptExecutionError>
pub fn terminate(&self) -> Result<(), JavascriptExecutionError>
pub fn pause(&self) -> Result<(), JavascriptExecutionError>
pub fn resume(&self) -> Result<(), JavascriptExecutionError>
pub fn send_stream_event( &self, event_type: &str, payload: Value, ) -> Result<(), JavascriptExecutionError>
pub fn respond_sync_rpc_success( &mut self, id: u64, result: Value, ) -> Result<(), JavascriptExecutionError>
Sourcepub fn claim_sync_rpc_response(
&mut self,
id: u64,
) -> Result<bool, JavascriptExecutionError>
pub fn claim_sync_rpc_response( &mut self, id: u64, ) -> Result<bool, JavascriptExecutionError>
Atomically claim the exact pending sync RPC before a caller performs a destructive operation on its behalf. A timed-out or replaced request must not consume bytes that belong to the guest’s next retry.
pub fn respond_claimed_sync_rpc_success( &mut self, id: u64, result: Value, ) -> Result<(), JavascriptExecutionError>
pub fn respond_sync_rpc_raw_success( &mut self, id: u64, payload: Vec<u8>, ) -> Result<(), JavascriptExecutionError>
pub fn respond_sync_rpc_error( &mut self, id: u64, code: impl Into<String>, message: impl Into<String>, ) -> Result<(), JavascriptExecutionError>
pub fn respond_claimed_sync_rpc_error( &mut self, id: u64, code: impl Into<String>, message: impl Into<String>, ) -> Result<(), JavascriptExecutionError>
pub async fn poll_event( &self, timeout: Duration, ) -> Result<Option<JavascriptExecutionEvent>, JavascriptExecutionError>
Sourcepub fn try_poll_event(
&self,
) -> Result<Option<JavascriptExecutionEvent>, JavascriptExecutionError>
pub fn try_poll_event( &self, ) -> Result<Option<JavascriptExecutionEvent>, JavascriptExecutionError>
Probe the durable event queue without registering or discarding a waker. The sidecar calls this after the execution engine has notified its coalesced process-event broker.
Sourcepub async fn poll_event_until(
&self,
timeout: Option<Duration>,
) -> Result<Option<JavascriptExecutionEvent>, JavascriptExecutionError>
pub async fn poll_event_until( &self, timeout: Option<Duration>, ) -> Result<Option<JavascriptExecutionEvent>, JavascriptExecutionError>
Wait for one event until an optional operation deadline. None is a
true readiness wait; it does not install a recurring adapter timer.
pub fn poll_event_blocking( &self, timeout: Duration, ) -> Result<Option<JavascriptExecutionEvent>, JavascriptExecutionError>
pub fn wait(self) -> Result<JavascriptExecutionResult, JavascriptExecutionError>
Sourcepub fn try_service_standalone_module_sync_rpc(
&mut self,
request: &JavascriptSyncRpcRequest,
) -> Result<bool, JavascriptExecutionError>
pub fn try_service_standalone_module_sync_rpc( &mut self, request: &JavascriptSyncRpcRequest, ) -> Result<bool, JavascriptExecutionError>
Service a module-resolution sync RPC host-directly, for consumers that
drive the V8 bridge without a kernel/service loop (the standalone
wait() loop and the Python/WASM prewarm loops). Uses this execution’s
own path translator (captured at start, including any runtime path
mappings) and a persistent cache. Returns Ok(true) if the request was a
module method and was answered, Ok(false) if it should fall through.
The real VM runtime resolves modules against the kernel VFS on the sidecar service loop and never calls this.