Skip to content

Commit

Permalink
feat: Make DataflowOpTrait public (#1283)
Browse files Browse the repository at this point in the history
Closes #1273
  • Loading branch information
doug-q authored Jul 15, 2024
1 parent 91f27f4 commit 56ae339
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 2 additions & 1 deletion hugr-core/src/ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
8 changes: 7 additions & 1 deletion hugr-core/src/ops/dataflow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 56ae339

Please sign in to comment.