pub trait RemoteSyncHandler {
type Client: SyncClient + Send + Sync + 'static;
type Account: Account + SyncStorage + Merge + ForceMerge + Send + Sync + 'static;
type Error: Error + Debug + AsConflict + From<ConflictError> + From<Error> + From<Error> + From<<Self::Account as Account>::Error> + From<<Self::Client as SyncClient>::Error> + Send + Sync + 'static;
// Required methods
fn client(&self) -> &Self::Client;
fn origin(&self) -> &Origin;
fn address(&self) -> &Address;
fn account(&self) -> Arc<Mutex<Self::Account>>;
fn direction(&self) -> SyncDirection;
fn file_transfer_queue(&self) -> &FileTransferQueueSender;
fn execute_sync_file_transfers<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided methods
fn create_account<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait,
'life0: 'async_trait { ... }
fn sync_account<'life0, 'async_trait>(
&'life0 self,
remote_status: SyncStatus,
) -> Pin<Box<dyn Future<Output = Result<MergeOutcome, Self::Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait,
'life0: 'async_trait { ... }
}Expand description
Trait for types that bridge between a remote data source and a local account.
Required Associated Types§
Sourcetype Client: SyncClient + Send + Sync + 'static
type Client: SyncClient + Send + Sync + 'static
Client used to fetch data from the data source.
Sourcetype Account: Account + SyncStorage + Merge + ForceMerge + Send + Sync + 'static
type Account: Account + SyncStorage + Merge + ForceMerge + Send + Sync + 'static
Local account.
Required Methods§
Sourcefn direction(&self) -> SyncDirection
fn direction(&self) -> SyncDirection
Direction for account creation and auto merge.
Sourcefn file_transfer_queue(&self) -> &FileTransferQueueSender
Available on crate feature files only.
fn file_transfer_queue(&self) -> &FileTransferQueueSender
files only.Queue for file transfers.
Provided Methods§
Sourcefn create_account<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
fn create_account<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
Create an account on local or remote depending on the sync direction.
Sourcefn sync_account<'life0, 'async_trait>(
&'life0 self,
remote_status: SyncStatus,
) -> Pin<Box<dyn Future<Output = Result<MergeOutcome, Self::Error>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
fn sync_account<'life0, 'async_trait>(
&'life0 self,
remote_status: SyncStatus,
) -> Pin<Box<dyn Future<Output = Result<MergeOutcome, Self::Error>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
Sync the account.
Implementors§
Source§impl RemoteSyncHandler for LinkedAccount
Available on crate feature integration only.
impl RemoteSyncHandler for LinkedAccount
Available on crate feature
integration only.