Skip to content

Error Help: Type inside async block must be known in this context #5102

Answered by Darksonn
dogou77 asked this question in Q&A
Discussion options

You must be logged in to vote

It seems like you aren't returning anything from the task, in which case the return type is (). In that case, you would use JoinHandle<()> as the type.

I note that this error sometimes comes from another error inhibiting type inference. If there are also other errors, you may want to try and fix those first.

You may find this page on graceful shutdown useful.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@dogou77
Comment options

Answer selected by dogou77
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants