pub struct WorkflowRun { /* private fields */ }Expand description
A live workflow run: owns the pending message queue, fan-in buffers, iteration count, shared state, and outstanding requests, so a run can pause (awaiting external input) and later resume.
Implementations§
Source§impl WorkflowRun
impl WorkflowRun
Sourcepub async fn send_response(
&mut self,
request_id: impl Into<String>,
value: Value,
) -> Result<(), Error>
pub async fn send_response( &mut self, request_id: impl Into<String>, value: Value, ) -> Result<(), Error>
Deliver a single response, resuming execution.
Sourcepub async fn send_responses(
&mut self,
responses: HashMap<String, Value>,
) -> Result<(), Error>
pub async fn send_responses( &mut self, responses: HashMap<String, Value>, ) -> Result<(), Error>
Deliver responses to outstanding requests and resume execution.
Each response is routed back to the executor that made the corresponding
request as a RequestResponse message.
Sourcepub fn events(&self) -> &[WorkflowEvent]
pub fn events(&self) -> &[WorkflowEvent]
All events observed during the run, in order.
Sourcepub fn state(&self) -> WorkflowRunState
pub fn state(&self) -> WorkflowRunState
The current run state.
Sourcepub fn pending_requests(&self) -> Vec<PendingRequest>
pub fn pending_requests(&self) -> Vec<PendingRequest>
Outstanding requests awaiting responses, ordered by request id.
Sourcepub fn last_output(&self) -> Option<Value>
pub fn last_output(&self) -> Option<Value>
The last workflow output, if any.
A handle to the run-scoped shared state (for inspection in tests/tools).
Auto Trait Implementations§
impl !RefUnwindSafe for WorkflowRun
impl !UnwindSafe for WorkflowRun
impl Freeze for WorkflowRun
impl Send for WorkflowRun
impl Sync for WorkflowRun
impl Unpin for WorkflowRun
impl UnsafeUnpin for WorkflowRun
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