Future created by async block is not `Send`

Hi,

I have this rust code, which attempts to tokio::spawn a call to a generic handler function, where the argument must be deserializable. I'm having trouble providing all the appropriate trait bounds and lifetimes. In particular, it's not clear to me how to provide bounds for a future created by an async block. I've tried to make every type that future can potentially reference Send as well, but things break down when I have to specify bounds for the associated Fut type of Handler. Some help would be greatly appreciated :slight_smile:

You are indeed missing a bunch of trait bounds, but it does seem like it's quite a pain to add them. It may be easier to add them in the trait definitions themselves.

1 Like