Skip to main content

Adapter

Trait Adapter 

Source
pub trait Adapter: Send + 'static {
    // Required methods
    fn agent_kind(&self) -> AgentKind;
    fn spawn(self: Box<Self>, ctx: AdapterContext) -> Result<AdapterHandle>;
}
Expand description

An agent adapter: tail a structured event stream and yield Events.

Implementations are Send + 'static so the recorder can spawn the tailer on its own thread. Adapter::spawn performs any setup that can fail (e.g. the tailer thread spawn) and returns an io::Error only for that low-level failure; higher-level “no transcript found” conditions are reported via the returned handle’s AdapterOutcome::status (degraded), not as an error, so the recorder can keep recording PTY/FS output (FR-1.5).

Required Methods§

Source

fn agent_kind(&self) -> AgentKind

The agent kind this adapter reports for the session row.

Source

fn spawn(self: Box<Self>, ctx: AdapterContext) -> Result<AdapterHandle>

Spawn the tailer thread, returning the event stream + outcome handle.

Takes self: Box<Self> so the recorder can dispatch through the Box<dyn Adapter> returned by select (a by-value self would not be callable on a trait object). A stateless adapter like ClaudeAdapter ignores the receiver.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§