ΒΆsus::Result<std::string, VarError> var(
const std::string& key) noexcept
sus::Result<std::string, VarError> var(
const std::string& key) noexcept
Description
Fetches the environment variable `key` from the current process. # Errors This function will return an error if the environment variable isn't set. This function may return an error if the `key` is not a valid multi-byte encoding for the current locale (typically utf8). This function may return an error if the environment variable's name contains the equal sign character `'='` or the NUL character `' \ 0'`. TODO: [Figure out](https://github.com/chromium/subspace/issues/326) a nicer way to receive unowned possibly-null-terminated strings. string_view reports a size before the null so you can't tell and you need to copy from it.
Declared at: sus/env/var.h:57
Parameters
- const std::string& key