Module resolution

Source
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§

WeakExtensionRegistry
The equivalent to an ExtensionRegistry that only contains weak references.

Enums§

ExtensionCollectionError
Errors that can occur when collecting extension requirements.
ExtensionResolutionError
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.