Skip to main content

Driver

Trait Driver 

Source
pub trait Driver: Send {
    // Required methods
    fn send<'life0, 'async_trait>(
        &'life0 mut self,
        frame: ClientFrame,
    ) -> Pin<Box<dyn Future<Output = Result<(), DriverError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn next_event<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Option<AgentEvent>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn shutdown<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Result<(), DriverError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

A unified driver interface. Concrete drivers translate this to their underlying wire format (PTY, stream-json, gRPC, ACP-stdio, A2A SSE).

Required Methods§

Source

fn send<'life0, 'async_trait>( &'life0 mut self, frame: ClientFrame, ) -> Pin<Box<dyn Future<Output = Result<(), DriverError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Send a frame to the agent. The frame is processed asynchronously; resulting events arrive via Driver::next_event.

Source

fn next_event<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Option<AgentEvent>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Await the next event from the agent. Returns None when the agent has exited cleanly.

Source

fn shutdown<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<(), DriverError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Shut down the agent process and release resources.

Implementors§