pub trait XftpExt: ClientApi {
// Required method
fn download_file<FID: Into<FileId>>(
&self,
file_id: FID,
) -> DownloadFileBuilder<'_, Self>;
}Available on crate feature
xftp only.Expand description
Adds download_file to any ClientApi.
Automatically implemented for XftpClient.
Required Methods§
Sourcefn download_file<FID: Into<FileId>>(
&self,
file_id: FID,
) -> DownloadFileBuilder<'_, Self>
fn download_file<FID: Into<FileId>>( &self, file_id: FID, ) -> DownloadFileBuilder<'_, Self>
Begin downloading file_id and return a builder to configure and await the result.
§Deadlock warning
download_file awaits a completion event that only arrives when the event loop processes
Awaiting a download inside a sequential handler blocks the event loop: that event
never arrives, causing a deadlock. Only use download_file from a concurrent handler
(registered with Dispatcher::on) or outside the
dispatcher entirely.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.