TODO: This might be a bad helper... maybe remove... TODO: AsRef Download a remote file and save it to a BNDB at the given `path`.
(
&self,
path: S,
progress: impl ProgressCallback,
)
| 465 | // TODO: AsRef<Path> |
| 466 | /// Download a remote file and save it to a BNDB at the given `path`. |
| 467 | pub fn download_database_with_progress<S: BnStrCompatible>( |
| 468 | &self, |
| 469 | path: S, |
| 470 | progress: impl ProgressCallback, |
| 471 | ) -> Result<Ref<FileMetadata>, ()> { |
| 472 | let mut progress = progress.split(&[50, 50]); |
| 473 | let file = self.download_with_progress(path, progress.next_subpart().unwrap())?; |
| 474 | let database = file.database().ok_or(())?; |
| 475 | self.sync_with_progress( |
| 476 | &database, |
| 477 | DatabaseConflictHandlerFail, |
| 478 | NoNameChangeset, |
| 479 | progress.next_subpart().unwrap(), |
| 480 | )?; |
| 481 | Ok(file) |
| 482 | } |
| 483 | |
| 484 | /// Completely sync a file, pushing/pulling/merging/applying changes |
| 485 | /// |
nothing calls this directly
no test coverage detected