Skip to main content

InMemoryRunControlStore

Struct InMemoryRunControlStore 

Source
pub struct InMemoryRunControlStore { /* private fields */ }
Expand description

Holds in memory run control store application-layer state or configuration. Use it with the documented coordinator methods; run, journal, event, provider, or port effects are called out on those methods rather than on construction.

Implementations§

Source§

impl InMemoryRunControlStore

Source

pub fn register_run( &self, run_id: RunId, agent_id: AgentId, ) -> Result<(), AgentError>

Register run. This inserts a run into in-memory test run-control state for deterministic handle tests.

Source

pub fn mark_visible_output_complete( &self, run_id: &RunId, output: impl Into<String>, ) -> Result<(), AgentError>

Mark visible output complete. This records final visible output in in-memory test run-control state.

Source

pub fn seal_terminal_result_from_journal( &self, record: &JournalRecord, output: impl Into<String>, ) -> Result<RunResult, AgentError>

Seals terminal run-control state from a journal terminal record. This stores the derived RunResult in the in-memory run-control map; it does not append a journal record, publish an event, or execute provider/tool work.

Source

pub fn cancel_request_count(&self, run_id: &RunId) -> Result<usize, AgentError>

Returns the cancel request count currently held by this value. This reads the number of cancellation requests recorded for the run.

Source

pub fn visible_output( &self, run_id: &RunId, ) -> Result<Option<String>, AgentError>

Returns visible output for callers that need to inspect the contract state. This reads visible output state from run control and does not change run status or output delivery.

Trait Implementations§

Source§

impl Clone for InMemoryRunControlStore

Source§

fn clone(&self) -> InMemoryRunControlStore

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for InMemoryRunControlStore

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for InMemoryRunControlStore

Source§

fn default() -> InMemoryRunControlStore

Returns the “default value” for a type. Read more
Source§

impl RunControlStore for InMemoryRunControlStore

Source§

fn status(&self, run_id: &RunId) -> Result<RunStatus, AgentError>

Returns the status currently held by this value. This reads run-control status for the handle and does not change the run.
Source§

fn terminal_result( &self, run_id: &RunId, ) -> Result<Option<RunResult>, AgentError>

Returns terminal result for callers that need to inspect the contract state. Implementations read terminal result state for the run and do not change run status.
Source§

fn request_cancel(&self, run_id: &RunId) -> Result<(), AgentError>

Requests cancellation for a registered run. Implementations may mutate run-control state to record the request; provider/tool cleanup remains owned by the run coordinator that observes the cancellation.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.