Creating a SafeFn
Chaining
You can create procedure chains by using .use()
. This is a function that takes in a SafeFn.
This parent SafeFn will run before the child it's defined on (including all callbacks). If it returns an Err
, the function is short circuited and input parsing/the handler on the child will not be executed. As such, the return type of the child safe-fn now includes the possible Err
values of the parent.
Setting a parent SafeFn also changes the available arguments for handler and callback functions, as outlined on their pages.