pub struct V8Runtime { /* private fields */ }Expand description
Manages an embedded V8 runtime and its IPC connection.
Implementations§
Source§impl V8Runtime
impl V8Runtime
Sourcepub fn create_session(
&mut self,
session_id: &str,
heap_limit_mb: u32,
cpu_time_limit_ms: u32,
wall_clock_limit_ms: u32,
) -> Result<()>
pub fn create_session( &mut self, session_id: &str, heap_limit_mb: u32, cpu_time_limit_ms: u32, wall_clock_limit_ms: u32, ) -> Result<()>
Create a new V8 isolate session.
Sourcepub fn inject_globals(
&mut self,
session_id: &str,
payload: Vec<u8>,
) -> Result<()>
pub fn inject_globals( &mut self, session_id: &str, payload: Vec<u8>, ) -> Result<()>
Inject per-session globals (processConfig, osConfig) as CBOR payload.
Sourcepub fn execute(
&mut self,
session_id: &str,
mode: u8,
file_path: &str,
bridge_code: &str,
user_code: &str,
) -> Result<()>
pub fn execute( &mut self, session_id: &str, mode: u8, file_path: &str, bridge_code: &str, user_code: &str, ) -> Result<()>
Execute bridge code + user code in a session.
Sourcepub fn send_bridge_response(
&mut self,
session_id: &str,
call_id: u64,
status: u8,
payload: Vec<u8>,
) -> Result<()>
pub fn send_bridge_response( &mut self, session_id: &str, call_id: u64, status: u8, payload: Vec<u8>, ) -> Result<()>
Send a bridge response back to the V8 isolate.
Sourcepub fn send_stream_event(
&mut self,
session_id: &str,
event_type: &str,
payload: Vec<u8>,
) -> Result<()>
pub fn send_stream_event( &mut self, session_id: &str, event_type: &str, payload: Vec<u8>, ) -> Result<()>
Send a stream event to the V8 isolate (stdin data, timer, child process events).
Sourcepub fn terminate_execution(&mut self, session_id: &str) -> Result<()>
pub fn terminate_execution(&mut self, session_id: &str) -> Result<()>
Terminate execution in a session.
Sourcepub fn destroy_session(&mut self, session_id: &str) -> Result<()>
pub fn destroy_session(&mut self, session_id: &str) -> Result<()>
Destroy a session.
Sourcepub fn read_frame(&mut self) -> Result<BinaryFrame>
pub fn read_frame(&mut self) -> Result<BinaryFrame>
Read the next frame from the V8 runtime.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for V8Runtime
impl RefUnwindSafe for V8Runtime
impl Send for V8Runtime
impl Sync for V8Runtime
impl Unpin for V8Runtime
impl UnsafeUnpin for V8Runtime
impl UnwindSafe for V8Runtime
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