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

Method put_trunk

atomic-core/tests/crdt_integration_test.rs:75–82  ·  view source on GitHub ↗
(&mut self, trunk: &Trunk)

Source from the content-addressed store, hash-verified

73 type Error = PristineError;
74
75 fn put_trunk(&mut self, trunk: &Trunk) -> Result<bool, Self::Error> {
76 let id = trunk.id();
77 let is_new = !self.trunks.contains_key(&id);
78 self.trunks.insert(id, trunk.clone());
79 self.path_index.insert(trunk.path().to_string(), id);
80 self.inode_index.insert(trunk.inode(), id);
81 Ok(is_new)
82 }
83
84 fn get_trunk(&self, id: TrunkId) -> Result<Option<Trunk>, Self::Error> {
85 Ok(self.trunks.get(&id).cloned())

Callers

nothing calls this directly

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