Skip to main content

TaskAdapter

Trait TaskAdapter 

Source
pub trait TaskAdapter {
    // Required methods
    fn adapter(&self) -> AdapterRef;
    fn rules(&self) -> AdapterRules;
    fn check_label(&self, label: &str) -> Result<(), String>;
    fn correct(
        &self,
        action: &str,
        params: &BTreeMap<String, OutValue>,
        label: &str,
    ) -> bool;
}
Expand description

How a task reads its judgments and labels.

Required Methods§

Source

fn adapter(&self) -> AdapterRef

Source

fn rules(&self) -> AdapterRules

What determines this adapter’s label check and correctness (spec 014, 3.1). No default: every adapter states whether its rules are bound to a document or opaque.

Source

fn check_label(&self, label: &str) -> Result<(), String>

Refuse a label of the wrong shape.

Source

fn correct( &self, action: &str, params: &BTreeMap<String, OutValue>, label: &str, ) -> bool

Whether a proposal is correct for a label. The adapter defines correctness; an unlabeled proposal is never correct or wrong.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§