You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
error[E0507]: cannot move out of `consumer`, a captured variable in an `FnMut` closure
--> src/broker/mod.rs:26:20
|
14 | let consumer: Arc<StreamConsumer> = Arc::new(ClientConfig::new()
| -------- captured outer variable
...
25 | let stream_processor = consumer.stream().try_for_each(|borrowed_message| {
| ------------------ captured by this `FnMut` closure
26 | async move {
| ____________________^
27 | | let _ = match borrowed_message.payload_view::<str>() {
28 | | None => "",
29 | | Some(Ok(s)) => s,
... |
35 | | consumer.commit_message(&borrowed_message, CommitMode::Async).unwrap();
| | --------
| | |
| | variable moved due to use in generator
| | move occurs because `consumer` has type `Arc<StreamConsumer>`, which does not implement the `Copy` trait
36 | | Ok(())
37 | | }
| |_________^ move out of `consumer` occurs here
error[E0505]: cannot move out of `consumer` because it is borrowed
--> src/broker/mod.rs:25:59
|
25 | let stream_processor = consumer.stream().try_for_each(|borrowed_message| {
| ----------------- ------------ ^^^^^^^^^^^^^^^^^^ move out of `consumer` occurs here
| | |
| | borrow later used by call
| borrow of `consumer` occurs here
...
35 | consumer.commit_message(&borrowed_message, CommitMode::Async).unwrap();
| -------- move occurs due to use in closure
Help me please.
The text was updated successfully, but these errors were encountered:
Hi,
I have used the example provided for the asynchronous processing. and tried commited message.
But I can't commited borrow message.
i get error
Help me please.
The text was updated successfully, but these errors were encountered: