Skip to main content

LanguageAdapter

Trait LanguageAdapter 

Source
pub trait LanguageAdapter: Send + Sync {
    // Required methods
    fn language(&self) -> CodingLanguage;
    fn diagnostic_sensor(&self) -> SensorRef;
    fn parse_diagnostics(
        &self,
        node_id: &str,
        generation: u32,
        raw: &str,
    ) -> Vec<ResidualEvent>;
    fn correction_for(
        &self,
        residual: &ResidualEvent,
    ) -> Option<CorrectionDirection>;

    // Provided methods
    fn smoke_invocations(&self, _workspace: &Path) -> Vec<SmokeInvocation> { ... }
    fn classify_runtime(
        &self,
        node_id: &str,
        generation: u32,
        invocation: &SmokeInvocation,
        exit_success: bool,
        output: &str,
    ) -> Vec<ResidualEvent> { ... }
}
Expand description

A coding language adapter: a verifier-suite provider for one language.

Required Methods§

Source

fn language(&self) -> CodingLanguage

Source

fn diagnostic_sensor(&self) -> SensorRef

The primary diagnostic sensor for this language.

Source

fn parse_diagnostics( &self, node_id: &str, generation: u32, raw: &str, ) -> Vec<ResidualEvent>

Parse raw diagnostic output into typed residuals.

Source

fn correction_for( &self, residual: &ResidualEvent, ) -> Option<CorrectionDirection>

Map a residual to a correction direction, or None when there is none.

Provided Methods§

Source

fn smoke_invocations(&self, _workspace: &Path) -> Vec<SmokeInvocation>

Runtime smoke invocations to exercise the built artifact’s entrypoints (PSP-8 runtime probe). Default: none — a new adapter opts in by overriding this. The runtime executes the returned commands from workspace.

Source

fn classify_runtime( &self, node_id: &str, generation: u32, invocation: &SmokeInvocation, exit_success: bool, output: &str, ) -> Vec<ResidualEvent>

Classify the output of a smoke invocation into Runtime residuals. Default: shared crash-marker + non-zero-exit detection.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§