(&mut self, trunk: &Trunk)
| 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()) |