]> git.proxmox.com Git - proxmox-backup.git/blobdiff - src/bin/proxmox-backup-client.rs
src/client/backup_writer.rs: move BackupClient code into extra file
[proxmox-backup.git] / src / bin / proxmox-backup-client.rs
index 68d4e467602c956af4ef175dcb2e6d654b6a4faf..dffdd989c12ab630b4374fdddd3dfc6b583dc99b 100644 (file)
@@ -180,7 +180,7 @@ fn compute_file_csum(file: &mut std::fs::File) -> Result<([u8; 32], u64), Error>
 
 
 async fn backup_directory<P: AsRef<Path>>(
-    client: &BackupClient,
+    client: &BackupWriter,
     dir_path: P,
     archive_name: &str,
     chunk_size: Option<usize>,
@@ -212,7 +212,7 @@ async fn backup_directory<P: AsRef<Path>>(
 }
 
 async fn backup_image<P: AsRef<Path>>(
-    client: &BackupClient,
+    client: &BackupWriter,
     image_path: P,
     archive_name: &str,
     image_size: u64,
@@ -723,9 +723,14 @@ fn create_backup(
     };
 
     async_main(async move {
-        let client = client
-            .start_backup(repo.store(), backup_type, &backup_id, backup_time, verbose)
-            .await?;
+        let client = BackupWriter::start(
+            client,
+            repo.store(),
+            backup_type,
+            &backup_id,
+            backup_time,
+            verbose,
+        ).await?;
 
         let mut file_list = vec![];