Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Visit ¶
func Visit(input interface{}, baseName string, parentVisibility compiled.Visibility, handler LeafHandler, target reflect.Type) error
Visit using reflect, browse through exposed addressable fields from input, and calls handler() if leaf.type == target
Types ¶
type LeafHandler ¶
LeafHandler is the handler function that will be called when Visit reaches leafs of the struct
type Tag ¶
type Tag string
Tag is a (optional) struct tag one can add to Variable to specify compiler.Compile() behavior
the tag format is as follow:
type MyCircuit struct {
Y frontend.Variable `gnark:"name,option"`
}
if empty, default resolves to variable name (here "Y") and secret visibility similarly to json or xml struct tags, these are valid:
`gnark:",public"` or `gnark:"-"`
using "-" marks the variable as ignored by the Compile method. This can be useful when you need to declare variables as aliases that are already allocated. For example
type MyCircuit struct {
Y frontend.Variable `gnark:",public"`
Z frontend.Variable `gnark:"-"`
}
it is then the developer responsability to do circuit.Z = circuit.Y in the Define() method