You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
or a similar dedicated trait to convert a SimpleReplacement to Replacement. This could also be a method on SimpleReplacement, but that would make it impossible to provide blanket implementations of Rewrite<PersistentHugr>.
This is required to be able to add SimpleReplacements to PersistentHugrs, which will (presumably) be made of Replacements.
Note that there is an argument for not implementing From, but rather a custom trait: one could imagine a rewrite struct InlineCall that only stores the Node ID of a call op, but can be turned into a Replacement if it is given a reference to the underlying Hugr: it needs to clone the body of the function to be inlined into the replacement graph. Such a conversion would have the signature fn into_replacement(self, hugr: &impl HugrView) -> Replacement
The text was updated successfully, but these errors were encountered:
Implement
or a similar dedicated trait to convert a
SimpleReplacement
toReplacement
. This could also be a method onSimpleReplacement
, but that would make it impossible to provide blanket implementations ofRewrite<PersistentHugr>
.This is required to be able to add
SimpleReplacement
s toPersistentHugr
s, which will (presumably) be made ofReplacement
s.Note that there is an argument for not implementing
From
, but rather a custom trait: one could imagine a rewrite structInlineCall
that only stores the Node ID of acall
op, but can be turned into aReplacement
if it is given a reference to the underlying Hugr: it needs to clone the body of the function to be inlined into the replacement graph. Such a conversion would have the signaturefn into_replacement(self, hugr: &impl HugrView) -> Replacement
The text was updated successfully, but these errors were encountered: