mod rclone_log;
pub mod wizard;
mod worker;
use std::path::PathBuf;
use crate::core::job::Job;
pub(crate) use worker::{ImportPlan, ImportSummary};
pub(crate) struct ImportJob {
pub source: String,
pub destination: String,
pub log_path: PathBuf,
}
impl Job for ImportJob {
type Plan = ImportPlan;
type Summary = ImportSummary;
async fn gather(&self) -> Result<ImportPlan, String> {
Ok(ImportPlan {
source: self.source.clone(),
destination: self.destination.clone(),
log_path: self.log_path.clone(),
})
}
async fn run(
self,
plan: ImportPlan,
_concurrency: usize,
_upload_concurrency: usize,
) -> Result<ImportSummary, String> {
worker::run_import_job(&plan.source, &plan.destination, &plan.log_path).await
}
}