Function nstd_sys::env::nstd_env_var

source ·
#[no_mangle]
pub unsafe extern "C" fn nstd_env_var(
    key: &NSTDStr
) -> NSTDIOStringResult<'_>
Available on crate feature nstd_env only.
Expand description

Retrieves a variable from the process environment.

Parameters:

  • const NSTDStr *key - The variable’s key.

Returns

NSTDIOStringResult var - The value of the environment variable, or the I/O operation error code on failure. This will return as NSTD_IO_ERROR_NOT_FOUND if they variable cannot be found, and NSTD_IO_ERROR_INVALID_DATA if the variable isn’t valid Unicode.

Safety

The user of this function must ensure that key is valid for reads.