Skip to main content

nix_store_path_to_string

Function nix_store_path_to_string 

Source
pub unsafe extern "C" fn nix_store_path_to_string(
    context: *mut nix_c_context,
    store: *mut Store,
    path: *const StorePath,
    callback: nix_get_string_callback,
    user_data: *mut c_void,
) -> nix_err
Expand description

Render a StorePath as its canonical /nix/store/… string. Calls store->printStorePath(path) and surfaces the result via the standard get-string callback protocol. Unlike nix_store_path_name, which only returns the name component, this returns the full path including the store directory and hash.

§Arguments

  • context [out] - Optional. Stores error information.
  • store [in] - Nix store reference whose store directory to use.
  • path [in] - Store path to render.
  • callback [in] - Receives the rendered string.
  • user_data [in] - Forwarded to the callback verbatim.

§Returns

NIX_OK on success, otherwise a nix_err describing the failure.