diff --git a/hugr-core/src/ops.rs b/hugr-core/src/ops.rs index 480db67ad..f44bfd136 100644 --- a/hugr-core/src/ops.rs +++ b/hugr-core/src/ops.rs @@ -23,7 +23,8 @@ pub use constant::{Const, Value}; pub use controlflow::{BasicBlock, Case, Conditional, DataflowBlock, ExitBlock, TailLoop, CFG}; pub use custom::CustomOp; pub use dataflow::{ - Call, CallIndirect, DataflowParent, Input, LoadConstant, LoadFunction, Output, DFG, + Call, CallIndirect, DataflowOpTrait, DataflowParent, Input, LoadConstant, LoadFunction, Output, + DFG, }; pub use leaf::{Lift, MakeTuple, Noop, Tag, UnpackTuple}; pub use module::{AliasDecl, AliasDefn, FuncDecl, FuncDefn, Module}; diff --git a/hugr-core/src/ops/dataflow.rs b/hugr-core/src/ops/dataflow.rs index 54202ffc0..4f90faedf 100644 --- a/hugr-core/src/ops/dataflow.rs +++ b/hugr-core/src/ops/dataflow.rs @@ -10,9 +10,15 @@ use crate::IncomingPort; #[cfg(test)] use ::proptest_derive::Arbitrary; -pub(crate) trait DataflowOpTrait { +/// Trait implemented by all dataflow operations. +pub trait DataflowOpTrait { + /// Tag identifying the operation. const TAG: OpTag; + + /// A human-readable description of the operation. fn description(&self) -> &str; + + /// The signature of the operation. fn signature(&self) -> FunctionType; /// The edge kind for the non-dataflow or constant inputs of the operation,