pub trait AgentBackend: Send + Sync {
// Required methods
fn name(&self) -> &str;
fn caps(&self) -> AgentCaps;
fn run<'life0, 'async_trait>(
&'life0 self,
turn: AgentTurn,
) -> Pin<Box<dyn Future<Output = Result<AgentReply, AgentError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Runs agent turns (design §4.1).
Dropping the future returned by AgentBackend::run must stop the work (and kill any child
process): the runtime cancels turns that way.
Required Methods§
Sourcefn run<'life0, 'async_trait>(
&'life0 self,
turn: AgentTurn,
) -> Pin<Box<dyn Future<Output = Result<AgentReply, AgentError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn run<'life0, 'async_trait>(
&'life0 self,
turn: AgentTurn,
) -> Pin<Box<dyn Future<Output = Result<AgentReply, AgentError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Runs one turn.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".