src/bin/proxmox-backup-client.rs: implement upload_config

This commit is contained in:
Dietmar Maurer
2019-06-03 10:39:44 +02:00
parent 39d6846e1e
commit ec8a9bb953
2 changed files with 35 additions and 14 deletions

View File

@ -431,14 +431,15 @@ impl BackupClient {
self.h2.clone().post("finish", None).map(|_| ())
}
pub fn upload_config(
pub fn upload_config<P: AsRef<std::path::Path>>(
&self,
src_path: P,
file_name: &str,
src_path: std::path::PathBuf,
) -> impl Future<Item=(), Error=Error> {
) -> impl Future<Item=(), Error=Error> {
let h2 = self.h2.clone();
let file_name = file_name.to_owned();
let src_path = src_path.as_ref().to_owned();
let task = tokio::fs::File::open(src_path)
.map_err(Error::from)