Skip to main content

CodeModeService

Trait CodeModeService 

Source
pub trait CodeModeService: Send + Sync {
    // Required methods
    fn search<'life0, 'async_trait>(
        &'life0 self,
        query: String,
    ) -> Pin<Box<dyn Future<Output = Result<SearchOutput, String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn execute<'life0, 'async_trait>(
        &'life0 self,
        code: String,
        options: CodeModeRunOptions,
    ) -> Pin<Box<dyn Future<Output = Result<ExecutionState, String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn execution<'life0, 'async_trait>(
        &'life0 self,
        execution_id: String,
    ) -> Pin<Box<dyn Future<Output = Result<ExecutionState, String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn artifact<'life0, 'async_trait>(
        &'life0 self,
        execution_id: String,
        artifact_id: String,
    ) -> Pin<Box<dyn Future<Output = Result<Value, String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn approve<'life0, 'async_trait>(
        &'life0 self,
        execution_id: String,
        seq: u64,
        options: CodeModeRunOptions,
    ) -> Pin<Box<dyn Future<Output = Result<ExecutionState, String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn reject<'life0, 'async_trait>(
        &'life0 self,
        execution_id: String,
        seq: u64,
    ) -> Pin<Box<dyn Future<Output = Result<ExecutionState, String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn cancel<'life0, 'async_trait>(
        &'life0 self,
        execution_id: String,
    ) -> Pin<Box<dyn Future<Output = Result<ExecutionState, String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Send-safe lifecycle boundary used by transports and native actor handles.

Required Methods§

Source

fn search<'life0, 'async_trait>( &'life0 self, query: String, ) -> Pin<Box<dyn Future<Output = Result<SearchOutput, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Searches current connector methods and saved snippets.

Source

fn execute<'life0, 'async_trait>( &'life0 self, code: String, options: CodeModeRunOptions, ) -> Pin<Box<dyn Future<Output = Result<ExecutionState, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Starts an execution and returns its durable running state.

Source

fn execution<'life0, 'async_trait>( &'life0 self, execution_id: String, ) -> Pin<Box<dyn Future<Output = Result<ExecutionState, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns one bounded execution snapshot by identifier.

Oversized values remain artifact references so transports can return the snapshot before retrieving a selected artifact.

Source

fn artifact<'life0, 'async_trait>( &'life0 self, execution_id: String, artifact_id: String, ) -> Pin<Box<dyn Future<Output = Result<Value, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns one artifact owned by an execution.

Source

fn approve<'life0, 'async_trait>( &'life0 self, execution_id: String, seq: u64, options: CodeModeRunOptions, ) -> Pin<Box<dyn Future<Output = Result<ExecutionState, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Approves a pending action and drives the next replay pass.

Source

fn reject<'life0, 'async_trait>( &'life0 self, execution_id: String, seq: u64, ) -> Pin<Box<dyn Future<Output = Result<ExecutionState, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Rejects a pending action.

Source

fn cancel<'life0, 'async_trait>( &'life0 self, execution_id: String, ) -> Pin<Box<dyn Future<Output = Result<ExecutionState, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Cancels a running or paused execution.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§