(&mut self, trunk: &Trunk)
| 500 | type Error = PristineError; |
| 501 | |
| 502 | fn put_trunk(&mut self, trunk: &Trunk) -> Result<bool, Self::Error> { |
| 503 | let is_new = !self.trunks.contains_key(&trunk.id()); |
| 504 | self.trunks.insert(trunk.id(), trunk.clone()); |
| 505 | self.path_index.insert(trunk.path().to_string(), trunk.id()); |
| 506 | self.inode_index.insert(trunk.inode(), trunk.id()); |
| 507 | Ok(is_new) |
| 508 | } |
| 509 | |
| 510 | fn get_trunk(&self, id: TrunkId) -> Result<Option<Trunk>, Self::Error> { |
| 511 | Ok(self.trunks.get(&id).cloned()) |