MCPcopy Create free account
hub / github.com/AppFlowy-IO/AppFlowy-Collab / update_map

Method update_map

collab/src/util.rs:327–335  ·  view source on GitHub ↗
(&self, txn: &mut TransactionMut, id: &str, f: F)

Source from the content-addressed store, hash-verified

325 }
326
327 fn update_map<F>(&self, txn: &mut TransactionMut, id: &str, f: F)
328 where
329 F: FnOnce(&mut HashMap<String, Any>),
330 {
331 let map_ref: MapRef = self.upsert(txn, id);
332 let mut map = map_ref.to_json(txn).into_map().unwrap();
333 f(&mut map);
334 Any::from(map).fill(txn, &map_ref).unwrap();
335 }
336
337 fn index_by_id<T: ReadTxn>(&self, txn: &T, id: &str) -> Option<u32> {
338 let i = self.iter(txn).position(|value| {

Callers 1

update_group_settingMethod · 0.80

Implementers 1

util.rscollab/src/util.rs

Calls 4

upsertMethod · 0.80
into_mapMethod · 0.80
fillMethod · 0.80
to_jsonMethod · 0.45

Tested by

no test coverage detected