code: func (q *Query) Iter(ctx context.Context, iter func(QueryResult) error) error {
  	f := &queryIDFactory{}
  	e := &eval{
  		ctx:          ctx,
  		cancel:       q.cancel,
  		query:        q.query,
  		queryIDFact:  f,
  		queryID:      f.Next(),
  		bindings:     newBindings(0, q.instr),
  		compiler:     q.compiler,
  		store:        q.store,
  		baseCache:    newBaseCache(),
  		targetStack:  newRefStack(),
  		txn:          q.txn,
  		input:        q.input,
  		tracers:      q.tracers,
  		instr:        q.instr,
  		builtinCache: builtins.Cache{},
  		virtualCache: newVirtualCache(),
  		genvarprefix: q.genvarprefix,
  		runtime:      q.runtime,
  	}
  	q.startTimer(metrics.RegoQueryEval)
  	defer q.stopTimer(metrics.RegoQueryEval)
  	return e.Run(func(e *eval) error {
  		qr := QueryResult{}
  		e.bindings.Iter(nil, func(k, v *ast.Term) error {
  			qr[k.Value.(ast.Var)] = v
  			return nil
  		})
  		return iter(qr)
  	})
  }
docs: // Iter executes the query and invokes the iter function with query results
  // produced by evaluating the query.