pub const nix_err_NIX_ERR_KEY: nix_err = -3;Expand description
A key/index access error occurred in C API functions. This error code is returned when accessing a key, index, or identifier that does not exist in C API functions. Common scenarios include:
- Setting keys that don’t exist (nix_setting_get, nix_setting_set)
- List indices that are out of bounds (nix_get_list_byidx*)
- Attribute names that don’t exist (nix_get_attr_byname*)
- Attribute indices that are out of bounds (nix_get_attr_byidx*, nix_get_attr_name_byidx) This error typically indicates incorrect usage or assumptions about data structure contents, rather than internal Nix evaluation errors.
Note This error code should ONLY be returned by C API functions themselves, not by underlying Nix evaluation. For example, evaluating
{}.fooin Nix will throw a normal error (NIX_ERR_NIX_ERROR), not NIX_ERR_KEY.