init_apply

Function init_apply 

Source
pub unsafe extern "C" fn init_apply(
    context: *mut c_context,
    value: *mut value,
    fn_: *mut value,
    arg: *mut value,
) -> err
Expand description

@brief Set the value to a thunk that will perform a function application when needed. @ingroup value_create

Thunks may be put into attribute sets and lists to perform some computation lazily; on demand. However, note that in some places, a thunk must not be returned, such as in the return value of a PrimOp. In such cases, you may use nix_value_call() instead (but note the different argument order).

@param[out] context Optional, stores error information @param[out] value Nix value to modify @param[in] fn function to call @param[in] arg argument to pass @return error code, NIX_OK on successful initialization. @see nix_value_call() for a similar function that performs the call immediately and only stores the return value. Note the different argument order.