Expand description
Utilities for resolving operations and types present in a HUGR, and updating the list of used extensions.
The functionalities of this module can be called from the type methods
crate::ops::OpType::used_extensions
and
crate::types::Signature::used_extensions
.
When listing “used extensions” we only care about definitional extension requirements, i.e., the operations and types that are required to define the HUGR nodes and wire types. This is computed from the union of all extension required across the HUGR.
Note: These procedures are only temporary until hugr-model
is stabilized.
Once that happens, hugrs will no longer be directly deserialized using serde
but instead will be created by the methods in crate::import
. As these
(will) automatically resolve extensions as the operations are created, we
will no longer require this post-facto resolution step.
Structs§
- Weak
Extension Registry - The equivalent to an
ExtensionRegistry
that only contains weak references.
Enums§
- Extension
Collection Error - Errors that can occur when collecting extension requirements.
- Extension
Resolution Error - Errors that can occur during extension resolution.
Functions§
- resolve_
custom_ type_ extensions - Update all weak Extension pointers in a custom type.
- resolve_
type_ extensions - Update all weak Extension pointers inside a type.
- resolve_
typearg_ extensions - Update all weak Extension pointers inside a type argument.
- resolve_
value_ extensions - Update all weak Extension pointers inside a constant value.