We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
CustomOp::extension
1 parent b7df2ef commit 8cd3ee9Copy full SHA for 8cd3ee9
hugr/src/ops/custom.rs
@@ -66,6 +66,14 @@ impl CustomOp {
66
}
67
68
69
+ /// Returns the extension ID of this operation.
70
+ pub fn extension(&self) -> &ExtensionId {
71
+ match self {
72
+ Self::Opaque(op) => op.extension(),
73
+ Self::Extension(op) => op.def.extension(),
74
+ }
75
76
+
77
/// If the operation is an instance of [ExtensionOp], return a reference to it.
78
/// If the operation is opaque, return None.
79
pub fn as_extension_op(&self) -> Option<&ExtensionOp> {
0 commit comments