#[non_exhaustive]pub struct Message<P> {
pub join_reference: Option<String>,
pub message_reference: String,
pub topic_name: String,
pub event_name: String,
pub payload: P,
}Expand description
Message received from the channel.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.join_reference: Option<String>The join_reference is also chosen by the client and should also be a unique value.
It only needs to be sent for a phx_join event; for other messages it can be null. It is
used as a message reference for push messages from the server, meaning those that are not
replies to a specific client message. For example, imagine something like “a new user just
joined the chat room”.
message_reference: StringThe message_reference is chosen by the client and should be a unique value.
The server includes it in its reply so that the client knows which message the reply is for.
topic_name: StringThe topic_name must be a known topic for the socket endpoint, and a client must join that
topic before sending any messages on it.
event_name: StringThe event_name must match the first argument of a handle_in function on the server channel
module.
payload: PThe payload should be a map and is passed as the second argument to that handle_in
function.