execute_function_body

Function execute_function_body 

Source
pub async fn execute_function_body(
    env: &mut Env,
    function: Rc<Function>,
    fields: Vec<Field>,
    env_prep_hook: Option<fn(&mut Env) -> Pin<Box<dyn Future<Output = ()>>>>,
) -> Result
Expand description

Executes the body of the function.

The given function is executed in the given environment. The fields are passed as positional parameters to the function except for the first field which is the name of the function.

env_prep_hook is called after the new variable context is pushed to the environment. This is useful for assigning custom local variables before the function body is executed.