err_NIX_ERR_KEY

Constant err_NIX_ERR_KEY 

Source
pub const err_NIX_ERR_KEY: err = -3;
Expand description

@brief 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 {}.foo in Nix will throw a normal error (NIX_ERR_NIX_ERROR), not NIX_ERR_KEY.