pub enum Event {
RoomJoined {
member_id: MemberId,
is_reconnect: bool,
},
RoomLeft {
close_reason: CloseReason,
},
PeerCreated {
peer_id: PeerId,
negotiation_role: NegotiationRole,
connection_mode: ConnectionMode,
tracks: Vec<Track>,
ice_servers: Vec<IceServer>,
force_relay: bool,
stats_scrape_interval_ms: u32,
},
SdpAnswerMade {
peer_id: PeerId,
sdp_answer: String,
},
LocalDescriptionApplied {
peer_id: PeerId,
sdp_offer: String,
},
IceCandidateDiscovered {
peer_id: PeerId,
candidate: IceCandidate,
},
PeersRemoved {
peer_ids: Vec<PeerId>,
},
PeerUpdated {
peer_id: PeerId,
updates: Vec<PeerUpdate>,
negotiation_role: Option<NegotiationRole>,
},
ConnectionQualityUpdated {
partner_member_id: MemberId,
quality_score: ConnectionQualityScore,
},
StateSynchronized {
state: Room,
},
}Expand description
Possible WebSocket messages sent from Media Server to Web Client.
Variants§
RoomJoined
Media Server notifies Web Client that a Member joined a Room.
Fields
is_reconnect: boolIndicator whether Media Server considers this Room connection as a
reconnect, meaning that there is already some runtime state on the
Media Server for the specified MemberId-Credential pair.
Server expects Command::SynchronizeMe if this is true.
RoomLeft
Media Server notifies Web Client that a Member left a Room.
Fields
close_reason: CloseReasonCloseReason with which the Member left the Room.
PeerCreated
Media Server notifies Web Client about necessity of an RTCPeerConnection creation.
Fields
peer_id: PeerIdID of the Peer to create an RTCPeerConnection for.
negotiation_role: NegotiationRoleNegotiationRole of the Peer.
connection_mode: ConnectionModetracks: Vec<Track>Tracks to create an RTCPeerConnection with.
ice_servers: Vec<IceServer>IceServers to create an RTCPeerConnection with.
force_relay: boolIndicator whether the created RTCPeerConnection should be
forced to use relay IceServers only.
stats_scrape_interval_ms: u32Interval (in milliseconds) of RTCPeerConnection’s stats scraping.
0 disables stats scraping.
SdpAnswerMade
Media Server notifies Web Client about necessity to apply the specified SDP Answer to Web Client’s RTCPeerConnection.
Fields
LocalDescriptionApplied
Media Server notifies Web Client that his SDP offer was applied.
Fields
IceCandidateDiscovered
Media Server notifies Web Client about necessity to apply the specified ICE Candidate.
Fields
candidate: IceCandidateICE Candidate to be applied.
PeersRemoved
Media Server notifies Web Client about necessity of the RTCPeerConnection close.
PeerUpdated
Media Server notifies about necessity to update Tracks in a Peer.
Fields
updates: Vec<PeerUpdate>List of PeerUpdates which should be applied.
negotiation_role: Option<NegotiationRole>Negotiation role basing on which should be sent
Command::MakeSdpOffer or Command::MakeSdpAnswer.
If None then no (re)negotiation should be done.
ConnectionQualityUpdated
Media Server notifies about connection quality score update.
Fields
quality_score: ConnectionQualityScoreEstimated connection quality.
StateSynchronized
Media Server synchronizes Web Client state and reports the proper one.
Implementations§
Source§impl Event
impl Event
Sourcepub async fn dispatch_with<T: EventHandler>(
self,
handler: &T,
) -> <T as EventHandler>::Output
pub async fn dispatch_with<T: EventHandler>( self, handler: &T, ) -> <T as EventHandler>::Output
Dispatches Event with given EventHandler.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Event
impl<'de> Deserialize<'de> for Event
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Event
impl StructuralPartialEq for Event
Auto Trait Implementations§
impl Freeze for Event
impl RefUnwindSafe for Event
impl Send for Event
impl Sync for Event
impl Unpin for Event
impl UnwindSafe for Event
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)