Struct io_providers::SimulatedEnv [−][src]
pub struct SimulatedEnv { /* fields omitted */ }
Provides inspection and manipulation of a simulated process environment.
Methods
impl SimulatedEnv
[src]
impl SimulatedEnv
pub fn new() -> SimulatedEnv
[src]
pub fn new() -> SimulatedEnv
Creates a new simulated environment.
pub fn set_args(&mut self, args: Vec<String>)
[src]
pub fn set_args(&mut self, args: Vec<String>)
Sets the arguments which this program was started with (normally passed via the command line).
pub fn set_args_os(&mut self, args: Vec<OsString>)
[src]
pub fn set_args_os(&mut self, args: Vec<OsString>)
Sets the arguments which this program was started with (normally passed via the command line).
pub fn set_current_exe<P: AsRef<Path>>(&mut self, path: P)
[src]
pub fn set_current_exe<P: AsRef<Path>>(&mut self, path: P)
Sets the path to be returned by Env::current_exe()
.
pub fn set_home_dir<P: AsRef<Path>>(&mut self, path: Option<P>)
[src]
pub fn set_home_dir<P: AsRef<Path>>(&mut self, path: Option<P>)
Sets the path to be returned by Env::home_dir()
.
pub fn set_temp_dir<P: AsRef<Path>>(&mut self, path: P)
[src]
pub fn set_temp_dir<P: AsRef<Path>>(&mut self, path: P)
Sets the path to be returned by Env::temp_dir()
.
Trait Implementations
impl Default for SimulatedEnv
[src]
impl Default for SimulatedEnv
fn default() -> SimulatedEnv
[src]
fn default() -> SimulatedEnv
Returns the "default value" for a type. Read more
impl Env for SimulatedEnv
[src]
impl Env for SimulatedEnv
type ArgsIter = IntoIter<String>
The iterator type returned by args()
.
type ArgsOsIter = IntoIter<OsString>
The iterator type returned by args_os()
.
type VarsIter = IntoIter<(String, String)>
The iterator type returned by vars()
.
type VarsOsIter = IntoIter<(OsString, OsString)>
The iterator type returned by vars_os()
.
fn args(&self) -> Self::ArgsIter
[src]
fn args(&self) -> Self::ArgsIter
Returns the arguments which this program was started with (normally passed via the command line). Read more
fn args_os(&self) -> Self::ArgsOsIter
[src]
fn args_os(&self) -> Self::ArgsOsIter
Returns the arguments which this program was started with (normally passed via the command line). Read more
fn current_dir(&self) -> Result<PathBuf>
[src]
fn current_dir(&self) -> Result<PathBuf>
Returns the current working directory as a PathBuf
. Read more
fn current_exe(&self) -> Result<PathBuf>
[src]
fn current_exe(&self) -> Result<PathBuf>
Returns the full filesystem path of the current running executable. Read more
fn home_dir(&self) -> Option<PathBuf>
[src]
fn home_dir(&self) -> Option<PathBuf>
: This function's behavior is unexpected and probably not what you want. Consider using the home_dir function from crates.io/crates/dirs instead.
Returns the path of the current user's home directory if known. Read more
fn remove_var<K: AsRef<OsStr>>(&mut self, k: K)
[src]
fn remove_var<K: AsRef<OsStr>>(&mut self, k: K)
Removes an environment variable from the environment of the currently running process. Read more
fn set_current_dir<P: AsRef<Path>>(&mut self, path: P) -> Result<()>
[src]
fn set_current_dir<P: AsRef<Path>>(&mut self, path: P) -> Result<()>
Changes the current working directory to the specified path, returning whether the change was completed successfully or not. Read more
fn set_var<K: AsRef<OsStr>, V: AsRef<OsStr>>(&mut self, k: K, v: V)
[src]
fn set_var<K: AsRef<OsStr>, V: AsRef<OsStr>>(&mut self, k: K, v: V)
Sets the environment variable k
to the value v
for the currently running process. Read more
fn temp_dir(&self) -> PathBuf
[src]
fn temp_dir(&self) -> PathBuf
Returns the path of a temporary directory. Read more
fn var<K: AsRef<OsStr>>(&self, key: K) -> Result<String, VarError>
[src]
fn var<K: AsRef<OsStr>>(&self, key: K) -> Result<String, VarError>
Fetches the environment variable key
from the current process. Read more
fn var_os<K: AsRef<OsStr>>(&self, key: K) -> Option<OsString>
[src]
fn var_os<K: AsRef<OsStr>>(&self, key: K) -> Option<OsString>
Fetches the environment variable key
from the current process. Read more
fn vars(&self) -> Self::VarsIter
[src]
fn vars(&self) -> Self::VarsIter
Returns an iterator of (variable, value) pairs of strings, for all the environment variables of the current process. Read more
fn vars_os(&self) -> Self::VarsOsIter
[src]
fn vars_os(&self) -> Self::VarsOsIter
Returns an iterator of (variable, value) pairs of OS strings, for all the environment variables of the current process. Read more
Auto Trait Implementations
impl Send for SimulatedEnv
impl Send for SimulatedEnv
impl Sync for SimulatedEnv
impl Sync for SimulatedEnv