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

Method put_trunk

atomic-core/src/crdt/apply/branch.rs:508–512  ·  view source on GitHub ↗

Trunk methods

(&mut self, trunk: &Trunk)

Source from the content-addressed store, hash-verified

506
507 // Trunk methods
508 fn put_trunk(&mut self, trunk: &Trunk) -> Result<bool, Self::Error> {
509 let is_new = !self.trunks.contains_key(&trunk.id());
510 self.trunks.insert(trunk.id(), trunk.clone());
511 Ok(is_new)
512 }
513
514 fn get_trunk(&self, id: TrunkId) -> Result<Option<Trunk>, Self::Error> {
515 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