pub enum BroadcastType<T: BroadcastTypeTrait> {
PointToPoint(T, T),
PointToGroup(T),
Unknown,
}Expand description
Represents the type of broadcast for WebSocket messages.
This enum allows specifying whether a message is intended for a direct point-to-point communication between two entities or for a group of entities.
§Type Parameters
T: The type used to identify points or groups, which must implementBroadcastTypeTrait.
Variants§
PointToPoint(T, T)
Indicates a point-to-point broadcast between two specific entities.
The tuple contains the identifiers of the two entities involved in the communication.
PointToGroup(T)
Indicates a broadcast to a specific group of entities.
The tuple contains the identifier of the group.
Unknown
Represents an unknown or unhandled broadcast type.
This variant is used as a default or fallback for unhandled cases.
Implementations§
Source§impl<B: BroadcastTypeTrait> BroadcastType<B>
impl<B: BroadcastTypeTrait> BroadcastType<B>
Sourcepub fn get_key(broadcast_type: BroadcastType<B>) -> String
pub fn get_key(broadcast_type: BroadcastType<B>) -> String
Generates a unique key string for a given broadcast type.
For point-to-point types, the keys are sorted to ensure consistent key generation regardless of the order of the input keys.
§Arguments
BroadcastType<B>- The broadcast type for which to generate the key.
§Returns
String- The unique key string for the broadcast type.
Trait Implementations§
Source§impl<T: Clone + BroadcastTypeTrait> Clone for BroadcastType<T>
impl<T: Clone + BroadcastTypeTrait> Clone for BroadcastType<T>
Source§fn clone(&self) -> BroadcastType<T>
fn clone(&self) -> BroadcastType<T>
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<T: Debug + BroadcastTypeTrait> Debug for BroadcastType<T>
impl<T: Debug + BroadcastTypeTrait> Debug for BroadcastType<T>
Source§impl<B: BroadcastTypeTrait> Default for BroadcastType<B>
Implements the Default trait for BroadcastType.
impl<B: BroadcastTypeTrait> Default for BroadcastType<B>
Implements the Default trait for BroadcastType.
The default value is BroadcastType::Unknown.
§Type Parameters
B: The type parameter forBroadcastType, which must implementBroadcastTypeTrait.
Source§impl<T: Hash + BroadcastTypeTrait> Hash for BroadcastType<T>
impl<T: Hash + BroadcastTypeTrait> Hash for BroadcastType<T>
Source§impl<T: PartialEq + BroadcastTypeTrait> PartialEq for BroadcastType<T>
impl<T: PartialEq + BroadcastTypeTrait> PartialEq for BroadcastType<T>
impl<T: Copy + BroadcastTypeTrait> Copy for BroadcastType<T>
impl<T: Eq + BroadcastTypeTrait> Eq for BroadcastType<T>
impl<T: BroadcastTypeTrait> StructuralPartialEq for BroadcastType<T>
Auto Trait Implementations§
impl<T> Freeze for BroadcastType<T>where
T: Freeze,
impl<T> RefUnwindSafe for BroadcastType<T>where
T: RefUnwindSafe,
impl<T> Send for BroadcastType<T>where
T: Send,
impl<T> Sync for BroadcastType<T>where
T: Sync,
impl<T> Unpin for BroadcastType<T>where
T: Unpin,
impl<T> UnwindSafe for BroadcastType<T>where
T: UnwindSafe,
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)