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

Fields

§member_id: MemberId

ID of the Member who joined the Room.

Media Server notifies Web Client that a Member joined a Room.

§

RoomLeft

Fields

§close_reason: CloseReason

CloseReason with which the Member left the Room.

Media Server notifies Web Client that a Member left a Room.

§

PeerCreated

Fields

§peer_id: PeerId

ID of the Peer to create RTCPeerConnection for.

§negotiation_role: NegotiationRole

NegotiationRole of the Peer.

§connection_mode: ConnectionMode

Indicator whether this Peer is working in a P2P mesh or SFU mode.

§tracks: Vec<Track>

Tracks to create RTCPeerConnection with.

§ice_servers: Vec<IceServer>

IceServers to create RTCPeerConnection with.

§force_relay: bool

Indicator whether the created RTCPeerConnection should be forced to use relay IceServers only.

Media Server notifies Web Client about necessity of RTCPeerConnection creation.

§

SdpAnswerMade

Fields

§peer_id: PeerId

ID of the Peer to apply SDP Answer to.

§sdp_answer: String

SDP Answer to be applied.

Media Server notifies Web Client about necessity to apply the specified SDP Answer to Web Client’s RTCPeerConnection.

§

LocalDescriptionApplied

Fields

§peer_id: PeerId

ID of the Peer which SDP offer was applied.

§sdp_offer: String

SDP offer that was applied.

Media Server notifies Web Client that his SDP offer was applied.

§

IceCandidateDiscovered

Fields

§peer_id: PeerId

ID of the Peer to apply ICE Candidate to.

§candidate: IceCandidate

ICE Candidate to be applied.

Media Server notifies Web Client about necessity to apply the specified ICE Candidate.

§

PeersRemoved

Fields

§peer_ids: Vec<PeerId>

IDs of Peers to be removed.

Media Server notifies Web Client about necessity of RTCPeerConnection close.

§

PeerUpdated

Fields

§peer_id: PeerId

ID of the Peer to update Tracks in.

§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.

Media Server notifies about necessity to update Tracks in a Peer.

§

ConnectionQualityUpdated

Fields

§partner_member_id: MemberId

Partner MemberId of the Peer.

§quality_score: ConnectionQualityScore

Estimated connection quality.

Media Server notifies about connection quality score update.

§

StateSynchronized

Fields

§state: Room

Proper state that should be assumed by Web Client.

Media Server synchronizes Web Client state and reports the proper one.

Implementations§

source§

impl Event

source

pub async fn dispatch_with<T: EventHandler>( self, handler: &T ) -> <T as EventHandler>::Output

Dispatches Event with given EventHandler.

Trait Implementations§

source§

impl Clone for Event

source§

fn clone(&self) -> Event

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Event

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for Event

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl PartialEq<Event> for Event

source§

fn eq(&self, other: &Event) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for Event

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Eq for Event

source§

impl StructuralEq for Event

source§

impl StructuralPartialEq for Event

Auto Trait Implementations§

§

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> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,