Macro hotdrink_rs::component [−][src]
A macro for specifying components.
This can be used to construct constraint systems declaratively by
combining the desired components in a ConstraintSystem
.
Examples
let component: Component<i32> = component! { component SumAndProduct { let a: i32 = 0, b: i32 = 0, c: i32 = 0, d: i32 = 0; constraint Sum { sum1(a: &i32, b: &i32) -> [c] = ret![*a + *b]; sum2(a: &i32, c: &i32) -> [b] = ret![*c - *a]; sum3(b: &i32, c: &i32) -> [a] = ret![*c - *b]; } constraint Product { product1(a: &i32, b: &i32) -> [d] = ret![*a * *b]; product2(a: &i32, d: &i32) -> [b] = ret![*d / *a]; product3(b: &i32, d: &i32) -> [a] = ret![*d / *b]; } } };