vyre_reference/cpu_op.rs
1//! CPU reference execution contract for operation implementations.
2
3use vyre::ir::Program;
4
5/// CPU reference implementation for an operation.
6pub trait CpuOp {
7 /// Execute one flat byte payload and append the byte output to `output`.
8 fn cpu(input: &[u8], output: &mut Vec<u8>);
9}
10
11/// Marker trait for Category A operations with an executable IR program.
12pub trait CategoryAOp {
13 /// Build the canonical Category A IR program.
14 fn program() -> Program;
15}
16
17/// Function pointer used by Category C descriptors.
18pub type CpuFn = fn(input: &[u8], output: &mut Vec<u8>);