pub struct DispatchSession { /* private fields */ }Expand description
One replay pass’s sequenced bridge between a sandbox and Rust connectors.
Implementations§
Source§impl DispatchSession
impl DispatchSession
Sourcepub async fn new(
runtime: Arc<CodeModeRuntime>,
execution_id: impl Into<String>,
connectors: Vec<Arc<dyn Connector>>,
) -> Result<Self, String>
pub async fn new( runtime: Arc<CodeModeRuntime>, execution_id: impl Into<String>, connectors: Vec<Arc<dyn Connector>>, ) -> Result<Self, String>
Resolves connector descriptions and creates a fresh replay cursor.
Sourcepub async fn new_with_descriptions(
runtime: Arc<CodeModeRuntime>,
execution_id: impl Into<String>,
connectors: Vec<Arc<dyn Connector>>,
snapshot: Vec<ConnectorDescription>,
) -> Result<Self, String>
pub async fn new_with_descriptions( runtime: Arc<CodeModeRuntime>, execution_id: impl Into<String>, connectors: Vec<Arc<dyn Connector>>, snapshot: Vec<ConnectorDescription>, ) -> Result<Self, String>
Creates a replay cursor using a previously captured capability snapshot.
Sourcepub async fn new_with_descriptions_and_context(
runtime: Arc<CodeModeRuntime>,
context: ToolContext,
connectors: Vec<Arc<dyn Connector>>,
snapshot: Vec<ConnectorDescription>,
) -> Result<Self, String>
pub async fn new_with_descriptions_and_context( runtime: Arc<CodeModeRuntime>, context: ToolContext, connectors: Vec<Arc<dyn Connector>>, snapshot: Vec<ConnectorDescription>, ) -> Result<Self, String>
Creates a replay cursor with an execution-scoped connector context.
Sourcepub fn descriptions(&self) -> Vec<ConnectorDescription>
pub fn descriptions(&self) -> Vec<ConnectorDescription>
Returns descriptions used to generate the child Worker bindings.
Sourcepub async fn call(
&self,
connector: &str,
method: &str,
arguments: Value,
now: u64,
) -> DispatchResponse
pub async fn call( &self, connector: &str, method: &str, arguments: Value, now: u64, ) -> DispatchResponse
Executes or replays one connector call under the runtime policy.
Sourcepub async fn call_at(
&self,
seq: u64,
connector: &str,
method: &str,
arguments: Value,
now: u64,
) -> DispatchResponse
pub async fn call_at( &self, seq: u64, connector: &str, method: &str, arguments: Value, now: u64, ) -> DispatchResponse
Executes or replays one connector call at an explicit sandbox sequence.
Sourcepub async fn begin_step(
&self,
name: &str,
now: u64,
) -> Result<StepResponse, RuntimeError>
pub async fn begin_step( &self, name: &str, now: u64, ) -> Result<StepResponse, RuntimeError>
Begins a deterministic local step.
Sourcepub async fn begin_step_at(
&self,
seq: u64,
name: &str,
now: u64,
) -> Result<StepResponse, RuntimeError>
pub async fn begin_step_at( &self, seq: u64, name: &str, now: u64, ) -> Result<StepResponse, RuntimeError>
Begins a deterministic local step at an explicit sandbox sequence.
Sourcepub async fn record_step(
&self,
seq: u64,
result: Value,
now: u64,
) -> Result<(), RuntimeError>
pub async fn record_step( &self, seq: u64, result: Value, now: u64, ) -> Result<(), RuntimeError>
Records a local step result for replay.
Sourcepub async fn pass_ended(&self, status: &str)
pub async fn pass_ended(&self, status: &str)
Notifies connectors that the current sandbox pass ended.
Sourcepub async fn execution_ended(&self, status: &str)
pub async fn execution_ended(&self, status: &str)
Notifies connectors that the execution reached a terminal state.
Auto Trait Implementations§
impl !Freeze for DispatchSession
impl !RefUnwindSafe for DispatchSession
impl !UnwindSafe for DispatchSession
impl Send for DispatchSession
impl Sync for DispatchSession
impl Unpin for DispatchSession
impl UnsafeUnpin for DispatchSession
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