api

environment.ch

Declarations in environment.ch

1 declarationsenvironment

Declarations

Public only
environment#
Publicnamespace
namespace environment
environment — cross-platform environment variable access.
get#
Publicfunction
func get(name : string_view) : Option<string>
Environment variable access
get_or#
Publicfunction
func get_or(name : string_view, default_val : string_view) : string
/ Get an environment variable with a default value.
set#
Publicfunction
func set(name : string_view, value : string_view) : Result<UnitTy, EnvError>
/ Set an environment variable.
unset#
Publicfunction
func unset(name : string_view) : Result<UnitTy, EnvError>
/ Unset/remove an environment variable.
path#
Publicfunction
func path() : Option<string>
---------------------------------------------------------------------------
home_dir#
Publicfunction
func home_dir() : Option<string>
/ Get the HOME (or USERPROFILE on Windows) directory.
user_name#
Publicfunction
func user_name() : Option<string>
/ Get the current user name.
current_dir#
Publicfunction
func current_dir() : Option<string>
/ Get the current working directory.
all#
Publicfunction
func all() : vector<string>
/ Enumerate all environment variables.
temp_dir#
Publicfunction
func temp_dir() : Option<string>
/ Get the temporary directory path.
shell#
Publicfunction
func shell() : Option<string>
/ Get the shell being used.
term#
Publicfunction
func term() : Option<string>
/ Get the terminal type.
UnitTy#
Publicstruct
struct UnitTy
---------------------------------------------------------------------------
make#
functionConstructor
func make() : UnitTy
---------------------------------------------------------------------------