Replies: 1 comment 3 replies
-
You're going to need to clone the future. Now as for what that entails--not entirely sure as I've never had to do it. Initial solution would be wrap in You might be able to scrap something together with the dyn_clone crate. But my guess is what you really need is a shared future, see the futures crate: https://docs.rs/futures/latest/futures/future/trait.FutureExt.html#method.shared |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I'm trying to execute from lib level an async function defined at project level. So, I'm trying to use an overridable capsule that returns
Box<dyn Future<Output = Result<(), String>> + Send + Sync + 'static>
but I got an error. Do you think there is a way to do it?I know ReArch and
Future
doesn't match very well. If you know an alternative way I would appreciate.Beta Was this translation helpful? Give feedback.
All reactions