#[unsafe(no_mangle)]pub unsafe extern "C" fn extism_function_new(
name: *const c_char,
inputs: *const ValType,
n_inputs: Size,
outputs: *const ValType,
n_outputs: Size,
func: ExtismFunctionType,
user_data: *mut c_void,
free_user_data: Option<extern "C" fn(*mut c_void)>,
) -> *mut ExtismFunctionExpand description
Create a new host function
Arguments
name: function name, this should be valid UTF-8inputs: argument typesn_inputs: number of argument typesoutputs: return typesn_outputs: number of return typesfunc: the function to calluser_data: a pointer that will be passed to the function when it’s called this value should live as long as the function existsfree_user_data: a callback to release theuser_datavalue when the resultingExtismFunctionis freed.
Returns a new ExtismFunction or null if the name argument is invalid.