Resolve "Support waiting for a transfer request to complete"
requested to merge amiranda/10-support-waiting-for-a-transfer-request-to-complete-via-std-future into main
This MR enables Cargo to keep track of transfer status so that it can be reported back to users.
It also extends the Cargo API as follows:
- Adds a new API function
transfer_dataset()as a convenience function to request the transfer of a single dataset. - Adds a
cargo::transfer_stateenum with appropriate values that reflect a transfer's current status. - Adds a
cargo::transfer_statusclass with functionsstate(),done(),failed()anderror()to retrieve a transfer's current status and its associated error condition in case of failure. - Extends the existing
cargo::transferclass with functionswait(), andwait_for(), to wait for the completion of a transfer request. - Promotes
cargo::error_codefromenumto aclassto allow for more expressiveness of error conditions. - Adds new error codes:
no_such_transferandtransfer_in_progress. - Adds new formatters:
cargo::transfer_stateandstd::optional<T>.
Closes #10 (closed)
Edited by Alberto Miranda