Enum medea_client_api_proto::Event
source · pub enum Event {
RoomJoined {
member_id: MemberId,
},
RoomLeft {
close_reason: CloseReason,
},
PeerCreated {
peer_id: PeerId,
negotiation_role: NegotiationRole,
connection_mode: ConnectionMode,
tracks: Vec<Track>,
ice_servers: Vec<IceServer>,
force_relay: bool,
},
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.
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 RTCPeerConnection creation.
Fields
negotiation_role: NegotiationRoleNegotiationRole of the Peer.
connection_mode: ConnectionModeSdpAnswerMade
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 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§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)