sagebind / isahc

The practical HTTP client that is fun to use.

Home Page:https://docs.rs/isahc

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Version 1.0 cannot use asynchronous copy_to_file?

gmg137 opened this issue · comments

hello, After I updated to version 1.0, I cannot use copy_to_file after get_async.

Using copy_to directly will prompt : future is not Send as it awaits another future which is not Send.
The problem seems to be caused by CopyFuture.

copy_to_file always was synchronous-only and should not be used in an asynchronous context. There is no async version of copy_to_file provided because std does not come with an asynchronous filesystem implementation, which is usually runtime-specific.

I think you are right though; CopyFuture ought to be Send if Response<T> is Send. This seems to be the same problem as #173 but must've been missed when it was fixed for text().

This has been fixed in 1.0.1!