pub trait ComputeOp: Send + Sync {
type Input;
type Output;
// Required methods
fn name(&self) -> &'static str;
fn execute(
&self,
input: Self::Input,
backend: Backend,
) -> Result<Self::Output, TruenoError>;
fn tokens(&self, input: &Self::Input) -> usize;
// Provided method
fn clone_input(&self, input: &Self::Input) -> Option<Self::Input>
where Self::Input: Clone { ... }
}Expand description
Trait for compute operations that can be wrapped in a ComputeBrick.