pub fn get_or_insert_with<T: Storable, B: Backend>( mem: &mut impl Mutex<T = ObjShelf<B>>, name: &str, f: impl FnOnce() -> T, ) -> Result<Option<Handle<T>>, Error<B::Error>>
Handle to the object name. If there is no object with this name (as on the first boot), inserts the value returned by f first; f only runs in that case, and it fails as insert does.
name
f
insert
T must be the type the object was inserted with, as for get.
T
get