-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compio IO crate #71
Compio IO crate #71
Conversation
Should we use RPITIT/AFIT as they're stablizing? Or stick with GAT and adopt later? @Berrysoft |
Do you know how long does it take to stablize? |
I just checked, there's some concerns during FCP, but I do expect them to be resolved soon, maybe in one or two weeks. |
I prefer to use them after they're stablized. |
Then I'll use assoc type for now. |
I changed my mind. I think we can just use AFIT, and wait for the rust team to stabilize it. |
I'm thinking if we need to support dyn by adding separate trait returning boxed future instead of generated anonymous future. Dyn traits can depend on non-dyn version, makes it effectively free for trait implementor. Here's an example. |
Is such trait object safe? |
Yes. The main reason why AFIT/RPITIT cannot be made into dyn object is because of its anonymous assoc type, which cannot be specified. I'm using box dyn to erase that type here. |
@Berrysoft how do you like the traits? BTW is it possible to stop the CI for this specific PR during drafting? I'm using nightly but the CI isn't happy about that. |
A side note: because compio is a thread-per-core runtime, we can safely disregard the lint comes with AFIT. We just need to remove it in some future version of rust. |
LGTM. |
Ok I forgot one important thing. Methods in |
d07308f
to
25fae38
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we also need read_to_end
and read_to_string
.
This PR adds
compio-io
and asyncRead
/Write
counterpart traits like those intokio
,futures
andmonoio
.