pub trait AgentService: Send {
// Required methods
fn integration(&self) -> AgentIntegration;
fn send(&mut self, request: AgentRequest);
fn poll(&mut self) -> Vec<AgentEvent>;
// Provided method
fn capabilities(&self) -> ClientCapabilities { ... }
}Expand description
The ACP client surface.
Behind a trait so the wire format is isolated (ADR-0003’s spec-churn mitigation), so a non-ACP backend could be substituted, and — most usefully day to day — so the whole review loop is testable against a scripted agent replaying a recorded stream.
Required Methods§
fn integration(&self) -> AgentIntegration
Sourcefn send(&mut self, request: AgentRequest)
fn send(&mut self, request: AgentRequest)
Queue work for the agent. Never blocks the caller.
Sourcefn poll(&mut self) -> Vec<AgentEvent>
fn poll(&mut self) -> Vec<AgentEvent>
Take whatever the agent has produced since the last call.
A drain rather than a callback so the single state owner stays in control of when events are applied (ARCHITECTURE.md §7.1).
Provided Methods§
fn capabilities(&self) -> ClientCapabilities
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".