hyperlane_plugin_websocket/websocket/enum.rs
1use crate::*;
2
3/// Represents the type of broadcast for WebSocket messages.
4///
5/// This enum allows specifying whether a message is intended for a direct
6/// point-to-point communication between two entities or for a group of entities.
7///
8/// # Type Parameters
9///
10/// - `T`: The type used to identify points or groups, which must implement `BroadcastTypeTrait`.
11#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
12pub enum BroadcastType<T: BroadcastTypeTrait> {
13 /// Indicates a point-to-point broadcast between two specific entities.
14 ///
15 /// The tuple contains the identifiers of the two entities involved in the communication.
16 PointToPoint(T, T),
17 /// Indicates a broadcast to a specific group of entities.
18 ///
19 /// The tuple contains the identifier of the group.
20 PointToGroup(T),
21 /// Represents an unknown or unhandled broadcast type.
22 ///
23 /// This variant is used as a default or fallback for unhandled cases.
24 Unknown,
25}