Skip to main content

Connector

Trait Connector 

Source
pub trait Connector {
    // Required methods
    fn detect(&self) -> DetectionResult;
    fn scan(
        &self,
        ctx: &ScanContext,
    ) -> Result<Vec<NormalizedConversation>, Error>;

    // Provided methods
    fn supports_streaming_scan(&self) -> bool { ... }
    fn discover_source_files(
        &self,
        _ctx: &ScanContext,
    ) -> Result<Vec<DiscoveredSourceFile>, Error> { ... }
    fn scan_with_callback(
        &self,
        ctx: &ScanContext,
        on_conversation: &mut dyn FnMut(NormalizedConversation) -> Result<(), Error>,
    ) -> Result<(), Error> { ... }
}
Expand description

The interface that all agent connectors implement.

Each connector knows how to detect whether a particular coding agent is installed and how to scan its conversation history.

Required Methods§

Source

fn detect(&self) -> DetectionResult

Detect whether this agent is installed on the system.

Source

fn scan(&self, ctx: &ScanContext) -> Result<Vec<NormalizedConversation>, Error>

Scan conversation history for this agent.

Provided Methods§

Source

fn supports_streaming_scan(&self) -> bool

Whether this connector implements true callback-based streaming.

Connectors that return true guarantee scan_with_callback() does not first materialize the full corpus via scan().

Source

fn discover_source_files( &self, _ctx: &ScanContext, ) -> Result<Vec<DiscoveredSourceFile>, Error>

Discover the raw source files this connector will consume for a scan.

Implementations must use the same provider-specific root expansion, filtering, and deduplication logic as scan() / scan_with_callback(). The contract is intentionally file-oriented and pre-parse: callers such as CASS can mirror precious source artifacts before parser failures, malformed records, or projection bugs can make a session invisible.

Source

fn scan_with_callback( &self, ctx: &ScanContext, on_conversation: &mut dyn FnMut(NormalizedConversation) -> Result<(), Error>, ) -> Result<(), Error>

Scan conversation history and emit conversations incrementally.

Connectors that can stream their traversal should override this to avoid materializing their full corpus in memory. The default implementation preserves current behavior by delegating to scan().

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§