Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HugrView::extract_hugr to extract views into owned hugrs. #1171

Closed
aborgna-q opened this issue Jun 6, 2024 · 0 comments · Fixed by #1173
Closed

HugrView::extract_hugr to extract views into owned hugrs. #1171

aborgna-q opened this issue Jun 6, 2024 · 0 comments · Fixed by #1173
Assignees
Labels
enhancement New feature or request

Comments

@aborgna-q
Copy link
Collaborator

Add a utility method to extract regions of a Hugr.
We currently have SiblingSubgraph::extract_subgraph for subgraphs, this should be the full-region equivalent.

This can then be used when an owned Hugr is expected, such as for the target of SimpleReplacement/Replacement.

@aborgna-q aborgna-q added the enhancement New feature or request label Jun 6, 2024
@aborgna-q aborgna-q self-assigned this Jun 6, 2024
github-merge-queue bot pushed a commit that referenced this issue Jun 6, 2024
…1173)

Add a `extract_hugr` method to extract regions into owned `Hugr`s.
The implementation is short-circuited for `Hugr` to avoid unnecessary
clones.

Closes #1171.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant