A function that gives us access to the [`FunctionContext`]. All functions have can accept this context as their first argument. The context is helpful for several reasons: 1. Creating shadowed variables using cloned contexts (see the `filter` and `map` functions for example). 2. Functions that are fallible can return an error message using ftx.error(...) which attaches some helpful context for the
(ftx: &FunctionContext)
| 44 | /// 2. Functions that are fallible can return an error message using ftx.error(...) |
| 45 | /// which attaches some helpful context for the error. |
| 46 | fn fail(ftx: &FunctionContext) -> ResolveResult { |
| 47 | ftx.error("This function always fails").into() |
| 48 | } |
| 49 | |
| 50 | /// A function that illustrates all the different types of values that are supported |
| 51 | /// as arguments to a function, as well as the fact that any of these types can also |