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
higher-ranked lifetime error
while spawning server in Tokio
#209
Comments
It seems to be related to the |
Can you give me the test project source code or repository url? |
If you change
|
Or here's a version using
Same error. I don't know whether it's a good idea to spawn the whole server as a tokio task or not. I'm trying to get it to run in the context of a Tauri plugin (https://tauri.app/v1/guides/features/plugin/) for an app that we're building where the salvo server (that usually runs as the backend server for the web-version of the app) is embedded in the tauri-app. Since Tauri wraps around a Tokio runtime itself and needs to start from a non-tokio main thread, we have to spawn the salvo server in a background thread, ideally managed by the same tokio runtime that tauri uses. |
Point is that this example works when you replace
So it seems that |
I have checked all futures in |
Saw that article yes. The suggested solution is hard to do though, boxing the future created by |
|
It's not just
Leaving out the call to |
So the question is, is this due to multiple causes? Like the one you mentioned regarding I saw your latest changes (adding |
Describe the bug
When trying to not configure and start the Salvo server on the main thread but in a spawned thread the compiler fails with a
higher-ranked lifetime error
and messages likenote: could not prove [async block@crate/server/src/server_builder.rs:115:22: 120:10]: Send
.To Reproduce
Steps to reproduce the behavior:
Additional context
rustc 1.68.0-nightly
The text was updated successfully, but these errors were encountered: