use crate::Result;
use crate::domain::ContractSet;
use crate::object::ObjectMeta;
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct OpInput {
pub name: String,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct OpOutput {
pub name: String,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct OpSignature {
pub inputs: Vec<OpInput>,
pub outputs: Vec<OpOutput>,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub enum LayerBehavior {
Pointwise,
NeighborhoodLocal,
CoverLocal,
Global,
PrecisionLayered,
ValuationFiltered,
}
pub trait Operator {
fn name(&self) -> &'static str;
fn signature(&self) -> OpSignature;
fn infer(&self, inputs: &[ObjectMeta]) -> Result<Vec<ObjectMeta>>;
fn required_contracts(&self) -> ContractSet;
fn provided_contracts(&self) -> ContractSet;
fn layer_behavior(&self) -> Vec<LayerBehavior>;
}