pub fn with_reset<F, O>(&self, f: F) -> O
  where
    F: FnOnce() -> O,
  {
    let mut val = self.val.write();
    *val = None;
    f()
  }
///
/// Run a function while the Resettable resource is cleared, and then recreate it afterward.
///
Run a function while the Resettable resource is cleared, and then recreate it afterward.
Run a function while the Resettable resource is cleared and then recreate it afterward .
pub fn with_reset<F, O>(&self, f: F) -> O
  where
    F: FnOnce() -> O,
  {
    let mut val = self.val.write();
    *val = None;
    f()
  }
pub fn with_reset < F , O > ( & self , f : F ) -> O where F : FnOnce ( ) -> O , { let mut val = self . val . write ( ) ; * val = None ; f ( ) }
Run a function while the Resettable resource is cleared, and then recreate it afterward.
Run a function while the Resettable resource is cleared and then recreate it afterward .
&self
f
F