pub fn with_storage<R, F: FnOnce() -> R>(storage: &mut StorageOverlay, f: F) -> R {
	let mut alt_storage = Default::default();
	rstd::mem::swap(&mut alt_storage, storage);
	let mut ext: BasicExternalities = alt_storage.into();
	let r = ext::using(&mut ext, f);
	*storage = ext.into();
	r
}
/// Execute the given closure with global functions available whose functionality routes into
/// externalities that draw from and populate `storage`. Forwards the value that the closure returns.
Execute the given closure with global functions available whose functionality routes into
externalities that draw from and populate `storage`. Forwards the value that the closure returns.
Execute the given closure with global functions available whose functionality routes into externalities that draw from and populate ` storage ` . Forwards the value that the closure returns .
pub fn with_storage<R, F: FnOnce() -> R>(storage: &mut StorageOverlay, f: F) -> R {
	let mut alt_storage = Default::default();
	rstd::mem::swap(&mut alt_storage, storage);
	let mut ext: BasicExternalities = alt_storage.into();
	let r = ext::using(&mut ext, f);
	*storage = ext.into();
	r
}
pub fn with_storage < R , F : FnOnce ( ) -> R > ( storage : & mut StorageOverlay , f : F ) -> R { let mut alt_storage = Default :: default ( ) ; rstd :: mem :: swap ( & mut alt_storage , storage ) ; let mut ext : BasicExternalities = alt_storage . into ( ) ; let r = ext :: using ( & mut ext , f ) ; * storage = ext . into ( ) ; r }
Execute the given closure with global functions available whose functionality routes into
externalities that draw from and populate `storage`.
Execute the given closure with global functions available whose functionality routes into externalities that draw from and populate ` storage ` .
storage
&mut StorageOverlay
f
F
storage
&mut StorageOverlay
f
F