pub struct SyncEngine { /* private fields */ }Expand description
Sync engine: handles batch and single-file synchronization.
Implementations§
Source§impl SyncEngine
impl SyncEngine
Sourcepub fn new(fs: VirtualFs, config: SyncConfig, fslog: FsLog) -> Self
pub fn new(fs: VirtualFs, config: SyncConfig, fslog: FsLog) -> Self
Create a new sync engine.
Sourcepub fn sync_filenames(
&self,
user_id: i64,
request: SyncRequest,
) -> Result<SyncResponse, SyncError>
pub fn sync_filenames( &self, user_id: i64, request: SyncRequest, ) -> Result<SyncResponse, SyncError>
Perform batch file synchronization.
Algorithm:
- Apply client deletions
- Save client modifications (merge on conflict)
- Send server files that the client doesn’t have
- Include rename log entries
Source§impl SyncEngine
impl SyncEngine
Sourcepub fn sync_media_filenames(
&self,
since_timestamp: i64,
) -> Result<MediaSyncResponse, SyncError>
pub fn sync_media_filenames( &self, since_timestamp: i64, ) -> Result<MediaSyncResponse, SyncError>
List media files modified since a given timestamp.
Returns all media files whose mtime > since_timestamp,
along with the latest timestamp for incremental sync.
Auto Trait Implementations§
impl !Freeze for SyncEngine
impl !RefUnwindSafe for SyncEngine
impl Send for SyncEngine
impl Sync for SyncEngine
impl Unpin for SyncEngine
impl UnsafeUnpin 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