Trait conch_runtime::env::VarEnvRestorer2 [] [src]

pub trait VarEnvRestorer2<E: ?Sized + VariableEnvironment>: VarEnvRestorer<E> {
    fn set_exported_var2(
        &mut self,
        name: E::VarName,
        val: E::Var,
        exported: Option<bool>,
        env: &mut E
    ); }

A corrected extension of the VarEnvRestorer trait, provided in a backwards compatible manner to avoid changes on the original trait.

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

Backup and set the value of some variable, either explicitly setting its exported status as specified, or maintaining its status as an environment variable if previously set as such.

Implementations on Foreign Types

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

[src]

Implementors