Movatterモバイル変換


[0]ホーム

URL:


Module env

std

Moduleenv 

1.0.0 ·Source
Expand description

Inspection and manipulation of the process’s environment.

This module contains functions to inspect various aspects such asenvironment variables, process arguments, the current directory, and variousother important directories.

There are several functions and structs in this module that have acounterpart ending inos. Those ending inos will return anOsStringand those without will return aString.

Modules§

consts
Constants associated with the current target

Structs§

Args
An iterator over the arguments of a process, yielding aString value foreach argument.
ArgsOs
An iterator over the arguments of a process, yielding anOsString valuefor each argument.
JoinPathsError
The error type for operations on thePATH variable. Possibly returned fromenv::join_paths().
SplitPaths
An iterator that splits an environment variable into paths according toplatform-specific conventions.
Vars
An iterator over a snapshot of the environment variables of this process.
VarsOs
An iterator over a snapshot of the environment variables of this process.

Enums§

VarError
The error type for operations interacting with environment variables.Possibly returned fromenv::var().

Functions§

args
Returns the arguments that this program was started with (normally passedvia the command line).
args_os
Returns the arguments that this program was started with (normally passedvia the command line).
current_dir
Returns the current working directory as aPathBuf.
current_exe
Returns the full filesystem path of the current running executable.
home_dir
Returns the path of the current user’s home directory if known.
join_paths
Joins a collection ofPaths appropriately for thePATHenvironment variable.
remove_var
Removes an environment variable from the environment of the currently running process.
set_current_dir
Changes the current working directory to the specified path.
set_var
Sets the environment variablekey to the valuevalue for the currently runningprocess.
split_paths
Parses input according to platform conventions for thePATHenvironment variable.
temp_dir
Returns the path of a temporary directory.
var
Fetches the environment variablekey from the current process.
var_os
Fetches the environment variablekey from the current process, returningNone if the variable isn’t set or if there is another error.
vars
Returns an iterator of (variable, value) pairs of strings, for all theenvironment variables of the current process.
vars_os
Returns an iterator of (variable, value) pairs of OS strings, for all theenvironment variables of the current process.

[8]ページ先頭

©2009-2026 Movatter.jp