pub struct ScopedPipefail(/* private fields */);Expand description
Overrides the pipefail 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 = ScopedPipefail::set(false);
run_cmd!(false | true)?; // Will have pipefail offImplementationsยง
Trait Implementationsยง
Sourceยงimpl Drop for ScopedPipefail
impl Drop for ScopedPipefail
Auto Trait Implementationsยง
impl !Send for ScopedPipefail
impl !Sync for ScopedPipefail
impl Freeze for ScopedPipefail
impl RefUnwindSafe for ScopedPipefail
impl Unpin for ScopedPipefail
impl UnsafeUnpin for ScopedPipefail
impl UnwindSafe for ScopedPipefail
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