pub struct V8SessionHandle { /* private fields */ }Expand description
A handle to a single V8 session within the shared runtime. Provides methods for sending frames specific to this session.
Implementations§
Source§impl V8SessionHandle
impl V8SessionHandle
pub fn new(session_id: String, runtime: Arc<EmbeddedV8Runtime>) -> Self
Sourcepub fn send_bridge_response(
&self,
call_id: u64,
status: u8,
payload: Vec<u8>,
) -> Result<()>
pub fn send_bridge_response( &self, call_id: u64, status: u8, payload: Vec<u8>, ) -> Result<()>
Send a bridge response back to the V8 isolate.
Sourcepub fn send_stream_event(
&self,
event_type: &str,
payload: Vec<u8>,
) -> Result<()>
pub fn send_stream_event( &self, event_type: &str, payload: Vec<u8>, ) -> Result<()>
Send a stream event to the V8 isolate (stdin data, timer, etc.).
Sourcepub fn set_module_reader(
&self,
reader: Box<dyn GuestModuleReader>,
) -> Result<()>
pub fn set_module_reader( &self, reader: Box<dyn GuestModuleReader>, ) -> Result<()>
Install a direct module-source reader on this session’s V8 thread so module loads read source directly instead of round-tripping the bridge.
Sourcepub fn execute(
&self,
mode: u8,
file_path: String,
bridge_code: String,
post_restore_script: String,
userland_code: String,
high_resolution_time: bool,
user_code: String,
wasm_module_bytes: Option<Arc<Vec<u8>>>,
) -> Result<()>
pub fn execute( &self, mode: u8, file_path: String, bridge_code: String, post_restore_script: String, userland_code: String, high_resolution_time: bool, user_code: String, wasm_module_bytes: Option<Arc<Vec<u8>>>, ) -> Result<()>
Execute bridge code + user code in this V8 session without routing through the legacy binary frame encode/decode path.
Sourcepub fn destroy(&self) -> Result<()>
pub fn destroy(&self) -> Result<()>
Destroy this session in the embedded runtime and remove its receiver.
pub fn session_id(&self) -> &str
Trait Implementations§
Source§impl Clone for V8SessionHandle
impl Clone for V8SessionHandle
Auto Trait Implementations§
impl Freeze for V8SessionHandle
impl RefUnwindSafe for V8SessionHandle
impl Send for V8SessionHandle
impl Sync for V8SessionHandle
impl Unpin for V8SessionHandle
impl UnsafeUnpin for V8SessionHandle
impl UnwindSafe for V8SessionHandle
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