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

Fields

§member_id: MemberId

ID of the Member who joined the Room.

§

RoomLeft

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

Fields

§close_reason: CloseReason

CloseReason with which the Member left the Room.

§

PeerCreated

Media Server notifies Web Client about necessity of RTCPeerConnection creation.

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.

§

SdpAnswerMade

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

Fields

§peer_id: PeerId

ID of the Peer to apply SDP Answer to.

§sdp_answer: String

SDP Answer to be applied.

§

LocalDescriptionApplied

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

Fields

§peer_id: PeerId

ID of the Peer which SDP offer was applied.

§sdp_offer: String

SDP offer that was applied.

§

IceCandidateDiscovered

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

Fields

§peer_id: PeerId

ID of the Peer to apply ICE Candidate to.

§candidate: IceCandidate

ICE Candidate to be applied.

§

PeersRemoved

Media Server notifies Web Client about necessity of RTCPeerConnection close.

Fields

§peer_ids: Vec<PeerId>

IDs of Peers to be removed.

§

PeerUpdated

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

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.

§

ConnectionQualityUpdated

Media Server notifies about connection quality score update.

Fields

§partner_member_id: MemberId

Partner MemberId of the Peer.

§quality_score: ConnectionQualityScore

Estimated connection quality.

§

StateSynchronized

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

Fields

§state: Room

Proper state that should be assumed by Web Client.

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 duplicate 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 for Event

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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 T
where 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 T
where T: Clone,

Source§

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 T
where U: Into<T>,

Source§

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 T
where U: TryFrom<T>,

Source§

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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

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