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
All(?) the methods in HugrView take &self, so to use it, h: &impl HugrView is all you need - easy for functions. However, for structs/storage, you have to decide between MyStruct<H:HugrView>{ h: H .... }, or MyStruct<'a, H:HugrView> { h: &'a H ... }, which is awkward and inflexible.
In practice this will probably mean replacing the current impl<T:AsRef<Hugr>> HugrView for T with two impls:
impl HugrView for Hugr { ... }
impl<T: HugrView> HugrView for &T
(possibly three, for &mut T, if we extend this to HugrMut, which we may want to too, although perhaps less important). Unfortunately this means more code/duplication, but the current situation is awkward for (increasing numbers of) clients....
The text was updated successfully, but these errors were encountered:
All(?) the methods in HugrView take
&self
, so to use it,h: &impl HugrView
is all you need - easy for functions. However, for structs/storage, you have to decide betweenMyStruct<H:HugrView>{ h: H .... }
, orMyStruct<'a, H:HugrView> { h: &'a H ... }
, which is awkward and inflexible.In practice this will probably mean replacing the current
impl<T:AsRef<Hugr>> HugrView for T
with two impls:(possibly three, for
&mut T
, if we extend this to HugrMut, which we may want to too, although perhaps less important). Unfortunately this means more code/duplication, but the current situation is awkward for (increasing numbers of) clients....The text was updated successfully, but these errors were encountered: