hyperlane_broadcast/broadcast_map/type.rs
1use crate::*;
2
3/// Represents an error that occurs when attempting to send a message via a broadcast channel within a map.
4pub type BroadcastMapSendError<T> = SendError<T>;
5
6/// Represents the result of a broadcast map send operation, indicating either success with an optional receiver count or an error.
7pub type BroadcastMapSendResult<T> = Result<Option<ReceiverCount>, BroadcastMapSendError<T>>;
8
9/// Represents a receiver endpoint for a broadcast channel within a map, allowing consumption of broadcasted messages.
10pub type BroadcastMapReceiver<T> = Receiver<T>;
11
12/// Represents an optional broadcast channel.
13pub type OptionBroadcast<T> = Option<Broadcast<T>>;
14
15/// Represents an optional receiver endpoint for a broadcast channel within a map.
16pub type OptionBroadcastMapReceiver<T> = Option<BroadcastMapReceiver<T>>;
17
18/// Represents a sender endpoint for a broadcast channel within a map, used to dispatch messages.
19pub type BroadcastMapSender<T> = Sender<T>;
20
21/// Represents an optional sender endpoint for a broadcast channel within a map.
22pub type OptionBroadcastMapSender<T> = Option<BroadcastMapSender<T>>;
23
24/// Represents an optional count of active receivers.
25pub type OptionReceiverCount = Option<ReceiverCount>;
26
27/// A concurrent, thread-safe map where keys are strings and values are broadcast channels.
28pub type DashMapStringBroadcast<T> = DashMap<String, Broadcast<T>, BuildHasherDefault<XxHash3_64>>;