error: cannot infer an appropriate lifetime
--> src/lib/iotcore.rs:156:24
|
156 | async fn subscribe(&self) -> Result<(), mqtt::Error> {
| ^^^^^
| |
| data with this lifetime...
| ...is captured here...
...
161 | self.client.set_message_callback(move |_cli, msg| {
| -------------------- ...and required to be `'static` by this
What would be the preferred way of moving messages out of the enclosure in this case or am I missing something in the docs on how to accomplish this in proper async way?
Hi,
On line 161 in my code here: https://github.com/braincow/maws2iotcore/blob/a028d5753fed5e986e038fa2e1a324d2a8e2c245/src/lib/iotcore.rs#L161 when I try to move a received message out from the enclosure of the callback I get a lifetime issue:
What would be the preferred way of moving messages out of the enclosure in this case or am I missing something in the docs on how to accomplish this in proper async way?