Skip to main content

AsyncScorer

Trait AsyncScorer 

Source
pub trait AsyncScorer:
    Send
    + Sync
    + 'static {
    // Required method
    fn score<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        expected: &'life1 Value,
        actual: &'life2 Value,
    ) -> Pin<Box<dyn Future<Output = ScorerOutcome> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
}
Expand description

Async-friendly scorer for impls that genuinely await — LLM judges, retrieval-grounded checks, anything network-bound. The blanket impl below promotes every sync Scorer into an AsyncScorer, so callers who hold Arc<dyn AsyncScorer> can accept both transparently.

Required Methods§

Source

fn score<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, expected: &'life1 Value, actual: &'life2 Value, ) -> Pin<Box<dyn Future<Output = ScorerOutcome> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Implementors§