MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / put_trunk

Method put_trunk

atomic-core/src/crdt/apply/leaf.rs:456–460  ·  view source on GitHub ↗

Trunk methods

(&mut self, trunk: &Trunk)

Source from the content-addressed store, hash-verified

454
455 // Trunk methods
456 fn put_trunk(&mut self, trunk: &Trunk) -> Result<bool, Self::Error> {
457 let is_new = !self.trunks.contains_key(&trunk.id());
458 self.trunks.insert(trunk.id(), trunk.clone());
459 Ok(is_new)
460 }
461
462 fn get_trunk(&self, id: TrunkId) -> Result<Option<Trunk>, Self::Error> {
463 Ok(self.trunks.get(&id).cloned())

Callers

nothing calls this directly

Calls 4

contains_keyMethod · 0.80
idMethod · 0.45
insertMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected