Trait hugr_core::extension::simple_op::MakeRegisteredOp
source · pub trait MakeRegisteredOp: MakeExtensionOp {
// Required methods
fn extension_id(&self) -> ExtensionId;
fn registry<'s, 'r: 's>(&'s self) -> &'r ExtensionRegistry;
// Provided method
fn to_extension_op(self) -> Option<ExtensionOp>
where Self: Sized { ... }
}
Expand description
Trait for operations that can self report the extension ID they belong to
and the registry required to compute their types.
Allows conversion to ExtensionOp
Required Methods§
sourcefn extension_id(&self) -> ExtensionId
fn extension_id(&self) -> ExtensionId
The ID of the extension this op belongs to.
sourcefn registry<'s, 'r: 's>(&'s self) -> &'r ExtensionRegistry
fn registry<'s, 'r: 's>(&'s self) -> &'r ExtensionRegistry
A reference to an ExtensionRegistry which is sufficient to generate the signature of this op.
Provided Methods§
sourcefn to_extension_op(self) -> Option<ExtensionOp>where
Self: Sized,
fn to_extension_op(self) -> Option<ExtensionOp>where
Self: Sized,
Convert this operation in to an ExtensionOp. Returns None if the type cannot be computed.