I've run into an interesting issue while planning out a futures executor design. I'm planning out an executor that is similar to python's SCOOP, with the idea that futures can be moved from one compute resource to another as resources become available. I can create my own implementations of Future
that also implement serde's
serialization interfaces, but that only works up until someone wants to pass in an async closure. As far as I know, it isn't possible to implement a trait on a closure today. I searched the archives, and the closest topic to this that I've been able to find is this one, but I didn't see an RFC come out of it.
So, have I missed the blindingly obvious, or is there currently no way to implement traits on closures? Is it possible to modify the language to permit this?