pub struct FileTransferServiceImpl { /* private fields */ }Expand description
Default file transfer service implementation.
Implementations§
Source§impl FileTransferServiceImpl
impl FileTransferServiceImpl
Sourcepub async fn new(
source_node: NodeId,
backend: Arc<dyn MessageBackend>,
stream_opener: Arc<dyn ChunkStreamOpener>,
config: FileTransferConfig,
) -> Result<FileTransferServiceImpl, FileTransferError>
pub async fn new( source_node: NodeId, backend: Arc<dyn MessageBackend>, stream_opener: Arc<dyn ChunkStreamOpener>, config: FileTransferConfig, ) -> Result<FileTransferServiceImpl, FileTransferError>
Sourcepub fn control(&self) -> Arc<ControlDispatcher>
pub fn control(&self) -> Arc<ControlDispatcher>
Returns the control dispatcher for sending/receiving control messages.
§Panics
This method does not panic.
Sourcepub fn receive_handler(&self) -> Arc<ReceiveHandler>
pub fn receive_handler(&self) -> Arc<ReceiveHandler>
Sourcepub fn path_validator(&self) -> &PathValidator
pub fn path_validator(&self) -> &PathValidator
Trait Implementations§
Source§impl FileTransferService for FileTransferServiceImpl
impl FileTransferService for FileTransferServiceImpl
Source§fn send_file<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
target: NodeId,
source_path: &'life1 Path,
dest_path: &'life2 Path,
options: TransferOptions,
) -> Pin<Box<dyn Future<Output = Result<TransferHandle, FileTransferError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
FileTransferServiceImpl: 'async_trait,
fn send_file<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
target: NodeId,
source_path: &'life1 Path,
dest_path: &'life2 Path,
options: TransferOptions,
) -> Pin<Box<dyn Future<Output = Result<TransferHandle, FileTransferError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
FileTransferServiceImpl: 'async_trait,
Sends a file to a target node. Read more
Source§fn broadcast_file<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
source_path: &'life1 Path,
dest_path: &'life2 Path,
options: TransferOptions,
) -> Pin<Box<dyn Future<Output = Result<BroadcastHandle, FileTransferError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
FileTransferServiceImpl: 'async_trait,
fn broadcast_file<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
source_path: &'life1 Path,
dest_path: &'life2 Path,
options: TransferOptions,
) -> Pin<Box<dyn Future<Output = Result<BroadcastHandle, FileTransferError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
FileTransferServiceImpl: 'async_trait,
Sends a file to all connected peers. Read more
Source§fn sync_file<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
local_path: &'life1 Path,
remote_path: &'life2 Path,
targets: Option<Vec<NodeId>>,
options: SyncOptions,
) -> Pin<Box<dyn Future<Output = Result<SyncHandle, FileTransferError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
FileTransferServiceImpl: 'async_trait,
fn sync_file<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
local_path: &'life1 Path,
remote_path: &'life2 Path,
targets: Option<Vec<NodeId>>,
options: SyncOptions,
) -> Pin<Box<dyn Future<Output = Result<SyncHandle, FileTransferError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
FileTransferServiceImpl: 'async_trait,
Synchronizes a local path with a remote path. Read more
Source§fn exists<'life0, 'life1, 'async_trait>(
&'life0 self,
target: NodeId,
path: &'life1 Path,
) -> Pin<Box<dyn Future<Output = Result<bool, FileTransferError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
FileTransferServiceImpl: 'async_trait,
fn exists<'life0, 'life1, 'async_trait>(
&'life0 self,
target: NodeId,
path: &'life1 Path,
) -> Pin<Box<dyn Future<Output = Result<bool, FileTransferError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
FileTransferServiceImpl: 'async_trait,
Checks if a path exists on a target node. Read more
Source§fn remove<'life0, 'life1, 'async_trait>(
&'life0 self,
target: NodeId,
path: &'life1 Path,
options: RemoveOptions,
) -> Pin<Box<dyn Future<Output = Result<(), FileTransferError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
FileTransferServiceImpl: 'async_trait,
fn remove<'life0, 'life1, 'async_trait>(
&'life0 self,
target: NodeId,
path: &'life1 Path,
options: RemoveOptions,
) -> Pin<Box<dyn Future<Output = Result<(), FileTransferError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
FileTransferServiceImpl: 'async_trait,
Removes a file or directory on a target node. Read more
Source§fn metadata<'life0, 'life1, 'async_trait>(
&'life0 self,
target: NodeId,
path: &'life1 Path,
) -> Pin<Box<dyn Future<Output = Result<FileMetadata, FileTransferError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
FileTransferServiceImpl: 'async_trait,
fn metadata<'life0, 'life1, 'async_trait>(
&'life0 self,
target: NodeId,
path: &'life1 Path,
) -> Pin<Box<dyn Future<Output = Result<FileMetadata, FileTransferError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
FileTransferServiceImpl: 'async_trait,
Fetches metadata for a file or directory on a target node. Read more
Source§fn list_files<'life0, 'life1, 'async_trait>(
&'life0 self,
target: NodeId,
dir_path: &'life1 Path,
options: ListOptions,
) -> Pin<Box<dyn Future<Output = Result<Vec<FileInfo>, FileTransferError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
FileTransferServiceImpl: 'async_trait,
fn list_files<'life0, 'life1, 'async_trait>(
&'life0 self,
target: NodeId,
dir_path: &'life1 Path,
options: ListOptions,
) -> Pin<Box<dyn Future<Output = Result<Vec<FileInfo>, FileTransferError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
FileTransferServiceImpl: 'async_trait,
Lists files within a directory on a target node. Read more
Source§fn cancel_transfer<'life0, 'async_trait>(
&'life0 self,
session_id: TransferSessionId,
) -> Pin<Box<dyn Future<Output = Result<(), FileTransferError>> + Send + 'async_trait>>where
'life0: 'async_trait,
FileTransferServiceImpl: 'async_trait,
fn cancel_transfer<'life0, 'async_trait>(
&'life0 self,
session_id: TransferSessionId,
) -> Pin<Box<dyn Future<Output = Result<(), FileTransferError>> + Send + 'async_trait>>where
'life0: 'async_trait,
FileTransferServiceImpl: 'async_trait,
Cancels an active transfer by session id. Read more
Source§fn pause_transfer<'life0, 'async_trait>(
&'life0 self,
session_id: TransferSessionId,
) -> Pin<Box<dyn Future<Output = Result<(), FileTransferError>> + Send + 'async_trait>>where
'life0: 'async_trait,
FileTransferServiceImpl: 'async_trait,
fn pause_transfer<'life0, 'async_trait>(
&'life0 self,
session_id: TransferSessionId,
) -> Pin<Box<dyn Future<Output = Result<(), FileTransferError>> + Send + 'async_trait>>where
'life0: 'async_trait,
FileTransferServiceImpl: 'async_trait,
Pauses an active transfer by session id. Read more
Source§fn resume_transfer<'life0, 'async_trait>(
&'life0 self,
session_id: TransferSessionId,
) -> Pin<Box<dyn Future<Output = Result<TransferHandle, FileTransferError>> + Send + 'async_trait>>where
'life0: 'async_trait,
FileTransferServiceImpl: 'async_trait,
fn resume_transfer<'life0, 'async_trait>(
&'life0 self,
session_id: TransferSessionId,
) -> Pin<Box<dyn Future<Output = Result<TransferHandle, FileTransferError>> + Send + 'async_trait>>where
'life0: 'async_trait,
FileTransferServiceImpl: 'async_trait,
Resumes a paused transfer by session id. Read more
Source§fn active_transfers(&self) -> Vec<TransferSessionInfo>
fn active_transfers(&self) -> Vec<TransferSessionInfo>
Returns a snapshot of active transfer sessions. Read more
Auto Trait Implementations§
impl Freeze for FileTransferServiceImpl
impl !RefUnwindSafe for FileTransferServiceImpl
impl Send for FileTransferServiceImpl
impl Sync for FileTransferServiceImpl
impl Unpin for FileTransferServiceImpl
impl !UnwindSafe for FileTransferServiceImpl
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