pub struct TestEnvGuard { /* private fields */ }Implementations§
Source§impl TestEnvGuard
impl TestEnvGuard
Sourcepub fn set(key: &'static str, value: &str) -> TestEnvGuard
pub fn set(key: &'static str, value: &str) -> TestEnvGuard
Set key to value, restoring the prior state on drop.
Blocks while another thread holds a live guard for the same variable; panics if the same thread nests a second guard for it.
Sourcepub fn remove(key: &'static str) -> TestEnvGuard
pub fn remove(key: &'static str) -> TestEnvGuard
Remove key from the environment, restoring the prior state on drop:
re-set to its previous value if it had one, otherwise left absent.
Blocking/panic behavior matches TestEnvGuard::set.
Trait Implementations§
Source§impl Drop for TestEnvGuard
impl Drop for TestEnvGuard
Auto Trait Implementations§
impl !Send for TestEnvGuard
impl Freeze for TestEnvGuard
impl RefUnwindSafe for TestEnvGuard
impl Sync for TestEnvGuard
impl Unpin for TestEnvGuard
impl UnsafeUnpin for TestEnvGuard
impl UnwindSafe for TestEnvGuard
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more