pub trait FileSyncClient {
type Error: Error + Debug;
// Required methods
fn upload_file<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
file_info: &'life1 ExternalFile,
path: &'life2 Path,
progress: ProgressChannel,
cancel: Receiver<CancelReason>,
) -> Pin<Box<dyn Future<Output = Result<StatusCode, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn download_file<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
file_info: &'life1 ExternalFile,
path: &'life2 Path,
progress: ProgressChannel,
cancel: Receiver<CancelReason>,
) -> Pin<Box<dyn Future<Output = Result<StatusCode, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn delete_file<'life0, 'life1, 'async_trait>(
&'life0 self,
file_info: &'life1 ExternalFile,
) -> Pin<Box<dyn Future<Output = Result<StatusCode, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn move_file<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
from: &'life1 ExternalFile,
to: &'life2 ExternalFile,
) -> Pin<Box<dyn Future<Output = Result<StatusCode, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn compare_files<'life0, 'async_trait>(
&'life0 self,
local_files: FileSet,
) -> Pin<Box<dyn Future<Output = Result<FileTransfersSet, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Available on crate feature
files and (crate features files or listen or network-client) only.Expand description
Client that can synchronize files.
Required Associated Types§
Required Methods§
Sourcefn upload_file<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
file_info: &'life1 ExternalFile,
path: &'life2 Path,
progress: ProgressChannel,
cancel: Receiver<CancelReason>,
) -> Pin<Box<dyn Future<Output = Result<StatusCode, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn upload_file<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
file_info: &'life1 ExternalFile,
path: &'life2 Path,
progress: ProgressChannel,
cancel: Receiver<CancelReason>,
) -> Pin<Box<dyn Future<Output = Result<StatusCode, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Send a file.
Sourcefn download_file<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
file_info: &'life1 ExternalFile,
path: &'life2 Path,
progress: ProgressChannel,
cancel: Receiver<CancelReason>,
) -> Pin<Box<dyn Future<Output = Result<StatusCode, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn download_file<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
file_info: &'life1 ExternalFile,
path: &'life2 Path,
progress: ProgressChannel,
cancel: Receiver<CancelReason>,
) -> Pin<Box<dyn Future<Output = Result<StatusCode, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Receive a file.
Sourcefn delete_file<'life0, 'life1, 'async_trait>(
&'life0 self,
file_info: &'life1 ExternalFile,
) -> Pin<Box<dyn Future<Output = Result<StatusCode, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_file<'life0, 'life1, 'async_trait>(
&'life0 self,
file_info: &'life1 ExternalFile,
) -> Pin<Box<dyn Future<Output = Result<StatusCode, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Delete a file on the remote server.
Sourcefn move_file<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
from: &'life1 ExternalFile,
to: &'life2 ExternalFile,
) -> Pin<Box<dyn Future<Output = Result<StatusCode, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn move_file<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
from: &'life1 ExternalFile,
to: &'life2 ExternalFile,
) -> Pin<Box<dyn Future<Output = Result<StatusCode, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Move a file on the remote server.
Sourcefn compare_files<'life0, 'async_trait>(
&'life0 self,
local_files: FileSet,
) -> Pin<Box<dyn Future<Output = Result<FileTransfersSet, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn compare_files<'life0, 'async_trait>(
&'life0 self,
local_files: FileSet,
) -> Pin<Box<dyn Future<Output = Result<FileTransfersSet, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Compare local files with a remote server.
Used to build a transfer queue that will eventually ensure external files are in sync.
Comparing sets of files is expensive as both local and remote need to read the external files state from disc so only use this when necessary.
Implementors§
Source§impl FileSyncClient for HttpClient
Available on crate feature network-client only.
impl FileSyncClient for HttpClient
Available on crate feature
network-client only.