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

Method put_trunk

atomic-core/src/crdt/apply/trunk.rs:388–394  ·  view source on GitHub ↗
(&mut self, trunk: &Trunk)

Source from the content-addressed store, hash-verified

386 type Error = crate::pristine::PristineError;
387
388 fn put_trunk(&mut self, trunk: &Trunk) -> Result<bool, Self::Error> {
389 let is_new = !self.trunks.contains_key(&trunk.id());
390 self.trunks.insert(trunk.id(), trunk.clone());
391 self.path_index.insert(trunk.path().to_string(), trunk.id());
392 self.inode_index.insert(trunk.inode(), trunk.id());
393 Ok(is_new)
394 }
395
396 fn get_trunk(&self, id: TrunkId) -> Result<Option<Trunk>, Self::Error> {
397 Ok(self.trunks.get(&id).cloned())

Callers 1

apply_createFunction · 0.45

Calls 6

contains_keyMethod · 0.80
idMethod · 0.45
insertMethod · 0.45
cloneMethod · 0.45
pathMethod · 0.45
inodeMethod · 0.45

Tested by

no test coverage detected