wasm_peers_protocol/many_to_many.rs
1/*!
2Signaling messages exchanged between used by NetworkManagers and signaling server
3to facilitate communication in many-to-many topology.
4*/
5
6use crate::{SessionId, UserId};
7use serde::{Deserialize, Serialize};
8
9/// Enum consisting of two main categories are messages used to setup signaling session
10/// and messages used to setup WebRTC connection afterwards.
11/// Most of the include [SessionId] and [UserId] to uniquely identify each peer.
12#[derive(Debug, Serialize, Deserialize)]
13pub enum SignalMessage {
14 /// Either client or server connecting to signaling session
15 SessionJoin(SessionId),
16
17 /// Report back to the users that both of them are in session
18 SessionReady(SessionId, UserId),
19
20 /// SDP Offer that gets passed to the other user without modifications
21 SdpOffer(SessionId, UserId, String),
22
23 /// SDP Answer that gets passed to the other user without modifications
24 SdpAnswer(SessionId, UserId, String),
25
26 /// Proposed ICE Candidate of one user passed to the other user without modifications
27 IceCandidate(SessionId, UserId, String),
28
29 /// Generic error containing detailed information about the cause
30 Error(SessionId, String),
31}