Closed nazar-pc closed 4 years ago
Note that you can create a regular std::fs::File
and then convert it into async_fs::File
with .into()
or async_fs::File::from(file)
.
But, it would also be possible to implement FromRawFd
for async_fs::File
if that helps. And, we could also add async fn into_inner()
that converts it back into std::fs::File
. What do you think?
File::from()
worked (compiled at least).
I do think it would be useful to have direct equivalents of additional APIs in the future as you've mentioned.
P.S. Your async-* crates are so pleasant to work with! :heart:
v1.3.0 now has File::from_raw_fd()
I'm writing a library that communicates with worker process using file descriptor. So in order to send and receive messages I'm creating files with File::from_raw_fd().
My understanding of this topic is very limited at the moment, so hopefully what I wrote makes sense :slightly_smiling_face: