pub struct SyncEngine { /* private fields */ }Implementations§
Source§impl SyncEngine
impl SyncEngine
pub async fn new() -> Result<Self, SyncError>
Sourcepub fn register_provider(
&mut self,
account_id: String,
provider: Box<dyn StorageProvider>,
)
pub fn register_provider( &mut self, account_id: String, provider: Box<dyn StorageProvider>, )
注册存储提供器到引擎
pub fn get_provider( &self, account_id: &str, ) -> Option<&Box<dyn StorageProvider>>
pub async fn walk_directory( &self, provider: &dyn StorageProvider, root: &str, ) -> Result<HashMap<String, FileMetadata>, SyncError>
pub async fn sync(&mut self, task: &SyncTask) -> Result<SyncReport, SyncError>
pub async fn sync_with_progress( &mut self, task: &SyncTask, progress_callback: impl Fn(SyncProgress) + Send + Sync + 'static, ) -> Result<SyncReport, SyncError>
Source§impl SyncEngine
impl SyncEngine
pub async fn verify_integrity( &self, task: &SyncTask, _verify_all: bool, progress_callback: impl Fn(VerificationProgress), ) -> Result<VerificationResult, SyncError>
pub async fn repair_integrity( &self, _task: &SyncTask, _verification_result: &VerificationResult, ) -> Result<RepairResult, SyncError>
pub async fn calculate_diff_for_dry_run( &self, task: &SyncTask, ) -> Result<DiffResult, SyncError>
Sourcepub fn save_report(&self, report: &SyncReport) -> Result<(), SyncError>
pub fn save_report(&self, report: &SyncReport) -> Result<(), SyncError>
保存同步报告到数据库
Sourcepub fn list_reports(
&self,
task_id: &str,
limit: usize,
offset: usize,
) -> Result<Vec<(String, i64, String, i64)>, SyncError>
pub fn list_reports( &self, task_id: &str, limit: usize, offset: usize, ) -> Result<Vec<(String, i64, String, i64)>, SyncError>
获取任务的报告列表
Sourcepub fn get_report(&self, report_id: &str) -> Result<SyncReport, SyncError>
pub fn get_report(&self, report_id: &str) -> Result<SyncReport, SyncError>
获取特定报告详情
Auto Trait Implementations§
impl Freeze for SyncEngine
impl !RefUnwindSafe for SyncEngine
impl Send for SyncEngine
impl Sync for SyncEngine
impl Unpin for SyncEngine
impl !UnwindSafe for SyncEngine
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more