Given how widely used spawn_blocking is within async-std itself, and how
useful it is for building other APIs, I think it makes sense to offer it
just as we do `spawn`, even though it isn't standard in Rust itself.
# [1.10.0] - 2021-08-25
This release comes with an assortment of small features and fixes.
## Added
- `File` now implements `Clone` so that `File`s can be passed into closures for use in `spawn_blocking`.
- `File`'s contents are already wrapped in `Arc`s, so the implementation of `Clone` is straightforward.
- `task::try_current()` which returns a handle to the current task if called within the context of a task created by async-std.
- `async_std::io` now re-exports `WriteExt` directly.
## Fixed
- `write!` now takes already written bytes into account on `File`.
## Internal
- `TcpStream` now properly makes use of vectored IO.
- The `net::*::Incoming` implementations now do less allocation.
## Docs
- Several docs improvements / fixes.
`UnixStream::into_raw_fd` calls `as_raw_fd`, which doesn't take the
ownership of the file descriptor, so the file descriptor is closed when
`self` is dropped upon returning from the function.
Because `UnixStream` uses a `Arc` to support Clone, there could be an
arbitrary number of instances around. We cannot take ownership of the
descriptor from all of the instances. Therefore we have no choice but to
duplicate the file descriptor and return that.
Fixes#855
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>