// calls the function f with the vault and loads a new instance after f has completed.
calls the function f with the vault and loads a new instance after f has completed.
calls the function f with the vault and loads a new instance after f has completed .
pub fn take<T>(&self, f: impl FnOnce(vault::DBView<P>) -> T) -> T {
        let mut _db = self.db.borrow_mut();
        let db = _db.take().expect(line_error!());
        let retval = f(db);
        // reload vault
        let req = connection::send_until_success(TransactionRequest::List).list();
        *_db = Some(vault::DBView::load(self.key.clone(), req).expect(line_error!()));
        retval
    }
pub fn take < T > ( & self , f : impl FnOnce ( vault :: DBView < P > ) -> T ) -> T { let mut _db = self . db . borrow_mut ( ) ; let db = _db . take ( ) . expect ( line_error ! ( ) ) ; let retval = f ( db ) ; // reload vault let req = connection :: send_until_success ( TransactionRequest :: List ) . list ( ) ; * _db = Some ( vault :: DBView :: load ( self . key . clone ( ) , req ) . expect ( line_error ! ( ) ) ) ; retval }
calls the function f with the vault and loads a new instance after f has completed.
calls the function f with the vault and loads a new instance after f has completed .
&self
<not_specific>
f
impl FnOnce(vault::DBView<P>) -> T
<not_specific>