pub struct ScopedDebug(/* private fields */);Expand description
Overrides the debug mode in the current thread, while the value is in scope.
Each override restores the previous value when dropped, so they can be nested. Since overrides are thread-local, these values can’t be sent across threads.
// Must give the variable a name, not just `_`
let _debug = ScopedDebug::set(true);
run_cmd!(echo hello world)?; // Will have debug onImplementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ScopedDebug
impl RefUnwindSafe for ScopedDebug
impl !Send for ScopedDebug
impl !Sync for ScopedDebug
impl Unpin for ScopedDebug
impl UnwindSafe for ScopedDebug
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