-
Notifications
You must be signed in to change notification settings - Fork 667
Description
I'd like to make use of futures in some embedded (arm) and separately in some kernel (macOS) code. In both of these places the code is no_std but implements the allocator api such that alloc::arc::Arc and alloc::boxed::Box are available.
I'm relatively new to rust so I may be wrong, but it appears to be impossible from outside futures-rs to replicate a couple of things that would unlock using futures in these situations:
- the
ArcWrappedUnsafeNotifyimplementation to avoid losing ones mind trying to implement notify handles impl Future for Boxwhich appears to be necessary to implement an executor like this one: https://github.com/alexcrichton/futures-rs/blob/2b3f0f0cc6b60f2659092dd3f2f88844c3f4bd5b/tests/support/local_executor.rs#L29
If there were a crate level feature selection to enable Box and Arc related conveniences and do so in terms of alloc rather than the std counterparts, I think it would make it significantly easier to integrate futures in these environments.
I'm also interested in guidance on how to achieve this without modifying futures-rs.
(I'd love to try futures-await in these environments too, while you're thinking about this!)