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

Method get_or_init_array

collab/src/util.rs:54–60  ·  view source on GitHub ↗
(&self, txn: &mut TransactionMut, key: S)

Source from the content-addressed store, hash-verified

52 }
53
54 fn get_or_init_array<S: Into<Arc<str>>>(&self, txn: &mut TransactionMut, key: S) -> ArrayRef {
55 let key = key.into();
56 match self.get(txn, &key) {
57 Some(Out::YArray(array)) => array,
58 _ => self.insert(txn, key, ArrayPrelim::default()),
59 }
60 }
61
62 fn get_or_init_text<S: Into<Arc<str>>>(&self, txn: &mut TransactionMut, key: S) -> TextRef {
63 let key = key.into();

Implementers 1

util.rscollab/src/util.rs

Calls 2

getMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected