Receiving messages
Besides the messages sent as a reply to a message, there are two categories of messages you can listen.
- Notification messages
- Regular messages
Notification messages
You can listen for notification messages with
Connection::on_notification, this will return Stream of
messages of the specified type.
Notification messages are denoted in the protobufs by being included in a
service block. See for example the FriendMessagesClient service.
In the generated code for the protobufs, notification messages implement the
ServiceMethodRequest trait.
Regular messages
For non-notification messages, you can use one to wait for a single
messages of a specific type or on to receive a stream of messages.