Available on crate feature
xftp only.Expand description
XFTP file download manager.
XftpClient wraps any ClientApi client and observes the file rcv events emitted by the
SimpleX-Chat. DownloadFileBuilder (obtained via XftpExt::download_file) initiates the transfer
and awaits those events, returning the outcome directly to the caller.
§When to use
-
Out-of-handler downloads. When the decision to download a file is made outside an event handler (for example, after a user command or a timer),
download_fileprovides the result without requiring custom event routing. -
Keeping download logic in one handler. Sometimes it may be useful to keep all logic in a single handler to simplify state management.
Structs§
- Download
File Builder - Xftp
Client - A
ClientApiwrapper that intercepts file-result events and routes them to the correspondingDownloadFileBuilderfutures. Should be constructed byEventStream::hook_xftpto work correctly.
Enums§
- Download
Error - Error returned when a
DownloadFileBuilderfuture resolves unsuccessfully.
Traits§
- XftpExt
- Adds
download_fileto anyClientApi. Automatically implemented forXftpClient.