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
A typical Tuxedo runtime is aggregated from individual pieces. This aggregation may even be recursive if #116 works out).
It is common that you need to convert between an inner and outer constraint checker or vise versa. The aggregation macro automatically implements From<inner> for Outer but there is no convenient way to go from outer to inner. One idea is to have the macro implement methods like this.
// This is an expansion of what would be macro-generated code.// I've elided the generic verifier for simplicity.pubenumOuterConstraintChecker{Money(money::Money),Amoeba(amoeba::Amoeba),}// An assumption about both directions of conversion is that each// constituent constraint checker is a unique type.// These impls for wrapping layers onto the onion already exist.implFrom(money::Money)forOuterConstraintChecker{ ...}
impl From(amoeba::Amoeba) for OuterConstraintChecker{ ...}// These ones could be added
impl From<OuterConstraintChecker>for money::Money{ ...}
impl From<OuterConstraintChecker>for amoeba::Amoeba{ ...}
A related issue is transforming a Transaction<OuterConstraintChecker> into a Transaction<InnerConstraintChecker> of vise versa. @muraca has given the idea of a transform method in 42f475c#diff-41e8e33684d0c2b86e827e306c10a1ce0787a681d8d9caf9191f178c09dfbe5eR23-R32 Previously I could only make that method work for wrapping the onion, but I think with the new From impls it would work both directions.
The text was updated successfully, but these errors were encountered:
A typical Tuxedo runtime is aggregated from individual pieces. This aggregation may even be recursive if #116 works out).
It is common that you need to convert between an inner and outer constraint checker or vise versa. The aggregation macro automatically implements
From<inner> for Outer
but there is no convenient way to go from outer to inner. One idea is to have the macro implement methods like this.A related issue is transforming a
Transaction<OuterConstraintChecker>
into aTransaction<InnerConstraintChecker>
of vise versa. @muraca has given the idea of atransform
method in 42f475c#diff-41e8e33684d0c2b86e827e306c10a1ce0787a681d8d9caf9191f178c09dfbe5eR23-R32 Previously I could only make that method work for wrapping the onion, but I think with the new From impls it would work both directions.The text was updated successfully, but these errors were encountered: