Replace the dropper with a new one and return the existing one so that we can await all the drop tasks being completed.
(&mut self)
| 280 | |
| 281 | /// Replace the dropper with a new one and return the existing one so that we can await all the drop tasks being completed. |
| 282 | pub fn take_dropper(&mut self) -> DropHandle { |
| 283 | let (mut drop_handle, mut drop_chute) = dropper::start(self.docker.clone()); |
| 284 | std::mem::swap(&mut drop_handle, &mut self.drop_handle); |
| 285 | std::mem::swap(&mut drop_chute, &mut self.drop_chute); |
| 286 | // By dropping the `drop_chute` the only the existing docker constructs will keep a reference to it. |
| 287 | // The caller can decide when it's time to wait on the handle, when the testnet have been dropped. |
| 288 | drop_handle |
| 289 | } |
| 290 | |
| 291 | /// Path to a directory based on a resource name. |
| 292 | fn path<T: AsRef<ResourceName>>(&self, name: T) -> PathBuf { |