Skip to content

Commit

Permalink
docs: Update message_event docs
Browse files Browse the repository at this point in the history
  • Loading branch information
SergioGasquez committed Jul 2, 2024
1 parent 14122b9 commit a4c563a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions book/src/03_5_3_mqtt.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ client.subscribe(subscribe_topic, QoS::AtLeastOnce)
## Handling Incoming Messages


The `message_event` parameter in the handler closure is of type `Result<Event<EspMqttMessage>`.
Since we're only interested in processing successfully received messages, we can make use of deep pattern matching into the closure:
The `message_event` parameter in the handler closure is of type `EspMqttEvent`, which has a `payload()` method to access the `EventPayload`
Since we're only interested in processing successfully received messages:

```rust
{{#include ../../intro/mqtt/exercise/examples/solution_publ_rcv.rs:mqtt_client}}
Expand Down

0 comments on commit a4c563a

Please sign in to comment.