Function nix_init_apply

Source
pub unsafe extern "C" fn nix_init_apply(
    context: *mut nix_c_context,
    value: *mut nix_value,
    fn_: *mut nix_value,
    arg: *mut nix_value,
) -> nix_err
Expand description

Set the value to a thunk that will perform a function application when needed. 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).

§Arguments

  • context [out] - Optional, stores error information
  • value [out] - Nix value to modify
  • fn [in] - function to call
  • arg [in] - argument to pass

§Returns

error code, NIX_OK on successful initialization.

§See also

nix_value_call() for a similar function that performs the call immediately and only stores the return value. Note the different argument order.