pub trait Operation: Send + Sync {
// Required methods
fn descriptor(&self) -> OperationDescriptor;
fn resolve(&self, params: Value) -> Result<Value, String>;
fn run(&self, params: &Value, inputs: &Inputs) -> Result<Outputs, String>;
// Provided methods
fn output_kind(
&self,
port: &Port,
_inputs: &BTreeMap<String, ArtifactKind>,
) -> ArtifactKind { ... }
fn summary(&self) -> &'static str { ... }
fn params_schema(&self) -> Value { ... }
}Expand description
One kind of pipeline step, for example a decomposition method.
Required Methods§
fn descriptor(&self) -> OperationDescriptor
Provided Methods§
Sourcefn output_kind(
&self,
port: &Port,
_inputs: &BTreeMap<String, ArtifactKind>,
) -> ArtifactKind
fn output_kind( &self, port: &Port, _inputs: &BTreeMap<String, ArtifactKind>, ) -> ArtifactKind
The kind an output will have, given the kinds bound to each input. By default the first kind the port lists; operations whose output follows their input override this.
Sourcefn summary(&self) -> &'static str
fn summary(&self) -> &'static str
One sentence on what the operation does, for modewise ops and the generated reference.
Sourcefn params_schema(&self) -> Value
fn params_schema(&self) -> Value
JSON Schema of the parameters: types, descriptions from doc comments, and defaults. The generated reference (docs/reference/operations.md) and tools read it.