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 publish_readiness(
&self,
capability_id: u64,
capability_generation: u64,
flags: ReadyFlags,
) -> Result<()>
pub fn publish_readiness( &self, capability_id: u64, capability_generation: u64, flags: ReadyFlags, ) -> Result<()>
Publish coalesced readiness for a registered sidecar capability. This carries no subsystem payload; the guest drain targets durable sidecar state by capability identity.
pub fn remove_readiness( &self, capability_id: u64, capability_generation: u64, ) -> Result<()>
pub fn set_application_read_interest( &self, capability_id: u64, capability_generation: u64, enabled: bool, ) -> Result<()>
pub fn publish_signal(&self, signal: i32) -> Result<()>
pub fn publish_timer(&self, timer_id: u64) -> Result<()>
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 pause(&self) -> Result<()>
pub fn pause(&self) -> Result<()>
Suspend guest execution while preserving the V8 stack and session state.
Sourcepub fn resume(&self) -> Result<()>
pub fn resume(&self) -> Result<()>
Resume a session previously suspended with Self::pause.
Sourcepub fn destroy(&self) -> Result<()>
pub fn destroy(&self) -> Result<()>
Destroy this session in the embedded runtime and remove its receiver.