Skip to main content

JavascriptExecution

Struct JavascriptExecution 

Source
pub struct JavascriptExecution { /* private fields */ }

Implementations§

Source§

impl JavascriptExecution

Source

pub fn execution_id(&self) -> &str

Source

pub fn child_pid(&self) -> u32

Source

pub fn v8_session_handle(&self) -> V8SessionHandle

Source

pub fn uses_shared_v8_runtime(&self) -> bool

Source

pub fn has_exited(&self) -> bool

Source

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.

Source

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.

Source

pub fn write_stdin( &mut self, chunk: &[u8], ) -> Result<(), JavascriptExecutionError>

Source

pub fn close_stdin(&mut self) -> Result<(), JavascriptExecutionError>

Source

pub fn read_kernel_stdin_sync_rpc( &self, request: &JavascriptSyncRpcRequest, ) -> Result<Value, JavascriptExecutionError>

Source

pub fn terminate(&self) -> Result<(), JavascriptExecutionError>

Source

pub fn pause(&self) -> Result<(), JavascriptExecutionError>

Source

pub fn resume(&self) -> Result<(), JavascriptExecutionError>

Source

pub fn send_stream_event( &self, event_type: &str, payload: Value, ) -> Result<(), JavascriptExecutionError>

Source

pub fn respond_sync_rpc_success( &mut self, id: u64, result: Value, ) -> Result<(), JavascriptExecutionError>

Source

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.

Source

pub fn respond_claimed_sync_rpc_success( &mut self, id: u64, result: Value, ) -> Result<(), JavascriptExecutionError>

Source

pub fn respond_sync_rpc_raw_success( &mut self, id: u64, payload: Vec<u8>, ) -> Result<(), JavascriptExecutionError>

Source

pub fn respond_sync_rpc_error( &mut self, id: u64, code: impl Into<String>, message: impl Into<String>, ) -> Result<(), JavascriptExecutionError>

Source

pub fn respond_claimed_sync_rpc_error( &mut self, id: u64, code: impl Into<String>, message: impl Into<String>, ) -> Result<(), JavascriptExecutionError>

Source

pub async fn poll_event( &self, timeout: Duration, ) -> Result<Option<JavascriptExecutionEvent>, JavascriptExecutionError>

Source

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.

Source

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.

Source

pub fn poll_event_blocking( &self, timeout: Duration, ) -> Result<Option<JavascriptExecutionEvent>, JavascriptExecutionError>

Source

pub fn wait(self) -> Result<JavascriptExecutionResult, JavascriptExecutionError>

Source

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.

Trait Implementations§

Source§

impl Debug for JavascriptExecution

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Drop for JavascriptExecution

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. 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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more