Trait conch_runtime::env::VarEnvRestorer [] [src]

pub trait VarEnvRestorer<E: ?Sized + VariableEnvironment> {
    fn reserve(&mut self, additional: usize);
fn set_exported_var(
        &mut self,
        name: E::VarName,
        val: E::Var,
        exported: bool,
        env: &mut E
    );
fn unset_var(&mut self, name: E::VarName, env: &mut E);
fn backup(&mut self, key: E::VarName, env: &E);
fn restore(&mut self, env: &mut E); }

An interface for maintaining a state of all variable definitions that have been modified so that they can be restored later.

Note: the caller should take care that a restorer instance is always called with the same environment for its entire lifetime. Using different environments with the same restorer instance will undoubtedly do the wrong thing eventually, and no guarantees can be made.

Required Methods

Reserves capacity for at least additional more variables to be backed up.

Deprecated

: Use VarEnvRestorer2::set_exported_var2 instead

Backup and set the value of some variable (and its exported status).

Backup and unset the value of some variable (including environment variables).

Backs up the original value of specified variable.

The original value of the variable is the one the environment held before it was passed into this wrapper. That is, if a variable is backed up multiple times, only the value before the first call could be restored later.

Restore all variable definitions to their original state.

Implementations on Foreign Types

impl<'a, T, E: ?Sized> VarEnvRestorer<E> for &'a mut T where
    T: VarEnvRestorer<E>,
    E: VariableEnvironment
[src]

[src]

[src]

Deprecated

: Use VarEnvRestorer2::set_exported_var2 instead

[src]

[src]

[src]

Implementors