Code
Pin<Box<dyn Future<Output = (bool, Option<Box<dyn Fn(&mut Context) -> ()>>)>>>
Error
Box::pin(Box::new((true, None)))
(bool, Option<_>)` is not a future
Code
Pin<Box<dyn Future<Output = (bool, Option<Box<dyn Fn(&mut Context) -> ()>>)>>>
Error
Box::pin(Box::new((true, None)))
(bool, Option<_>)` is not a future
Box::pin
creates a new box, not pin an existing one.
Try:
Box::pin((true, None))
edit: oops yeah @Alice is right, maybe I should take a break from thinking for a bit
If you want the actual type that you wrote, then you should do this:
Box::pin(async { (true, None) })
The async block is an expression that creates a future.
Thank you so much
This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.