Skip to main content

Adapter

Trait Adapter 

Source
pub trait Adapter {
    // Required methods
    fn id(&self) -> &'static str;
    fn detect(&self) -> bool;
    fn discover(&self) -> Result<Vec<SessionRef>>;
    fn parse(&self, r: &SessionRef) -> Result<Session>;
}
Expand description

One supported agent’s on-disk format.

Required Methods§

Source

fn id(&self) -> &'static str

Stable identifier used by --agent, e.g. "claude-code".

Source

fn detect(&self) -> bool

Cheap check: are this agent’s data files present on this machine?

Source

fn discover(&self) -> Result<Vec<SessionRef>>

Find session files (read-only; never modifies anything).

Source

fn parse(&self, r: &SessionRef) -> Result<Session>

Parse one session file into the normalized model. Must be lenient: unknown/corrupt lines are skipped with a tracing::debug, never a panic, and never abort the whole file (CLAUDE.md §9).

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§