pub struct Guard<T: Restore> {
state: Option<T>,
}Expand description
Sets modem state back on every path.
Guard::restore restores the state with the client of the test and
reports errors. If the guard is dropped without that, for example after a
panic or an early return, it restores the state with a new client on its
own thread and prints errors.
Fields§
§state: Option<T>Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Guard<T>
impl<T> RefUnwindSafe for Guard<T>where
Option<T>: RefUnwindSafe,
impl<T> Send for Guard<T>
impl<T> Sync for Guard<T>
impl<T> Unpin for Guard<T>
impl<T> UnsafeUnpin for Guard<T>where
Option<T>: UnsafeUnpin,
impl<T> UnwindSafe for Guard<T>where
Option<T>: UnwindSafe,
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