Apply returns a new `ExprContext` with the fields updated according to the given options.
(opts ...ExprCtxOption)
| 191 | |
| 192 | // Apply returns a new `ExprContext` with the fields updated according to the given options. |
| 193 | func (ctx *ExprContext) Apply(opts ...ExprCtxOption) *ExprContext { |
| 194 | newCtx := &ExprContext{ |
| 195 | exprCtxState: ctx.exprCtxState, |
| 196 | } |
| 197 | |
| 198 | for _, opt := range opts { |
| 199 | opt(&newCtx.exprCtxState) |
| 200 | } |
| 201 | |
| 202 | return newCtx |
| 203 | } |
| 204 | |
| 205 | // GetEvalCtx implements the `ExprContext.GetEvalCtx`. |
| 206 | func (ctx *ExprContext) GetEvalCtx() exprctx.EvalContext { |