Trait CommandHandler

Source
pub trait CommandHandler {
    type Output;

    // Required methods
    fn on_join_room(
        &mut self,
        member_id: MemberId,
        credential: Credential,
        capabilities: Capabilities,
    ) -> Self::Output;
    fn on_leave_room(&mut self, member_id: MemberId) -> Self::Output;
    fn on_make_sdp_offer(
        &mut self,
        peer_id: PeerId,
        sdp_offer: String,
        mids: HashMap<TrackId, String>,
        transceivers_statuses: HashMap<TrackId, bool>,
    ) -> Self::Output;
    fn on_make_sdp_answer(
        &mut self,
        peer_id: PeerId,
        sdp_answer: String,
        transceivers_statuses: HashMap<TrackId, bool>,
    ) -> Self::Output;
    fn on_set_ice_candidate(
        &mut self,
        peer_id: PeerId,
        candidate: IceCandidate,
    ) -> Self::Output;
    fn on_add_peer_connection_metrics(
        &mut self,
        peer_id: PeerId,
        metrics: PeerMetrics,
    ) -> Self::Output;
    fn on_update_tracks(
        &mut self,
        peer_id: PeerId,
        tracks_patches: Vec<TrackPatchCommand>,
    ) -> Self::Output;
    fn on_synchronize_me(&mut self, state: Room) -> Self::Output;
}
Expand description

Handler of Command variants.

Using Command::dispatch_with method dispatches Command variants to appropriate methods of this trait.

Required Associated Types§

Source

type Output

Output type of all functions from this trait.

Required Methods§

Source

fn on_join_room( &mut self, member_id: MemberId, credential: Credential, capabilities: Capabilities, ) -> Self::Output

Handles Command::JoinRoom variant of Command.

Source

fn on_leave_room(&mut self, member_id: MemberId) -> Self::Output

Handles Command::LeaveRoom variant of Command.

Source

fn on_make_sdp_offer( &mut self, peer_id: PeerId, sdp_offer: String, mids: HashMap<TrackId, String>, transceivers_statuses: HashMap<TrackId, bool>, ) -> Self::Output

Handles Command::MakeSdpOffer variant of Command.

Source

fn on_make_sdp_answer( &mut self, peer_id: PeerId, sdp_answer: String, transceivers_statuses: HashMap<TrackId, bool>, ) -> Self::Output

Handles Command::MakeSdpAnswer variant of Command.

Source

fn on_set_ice_candidate( &mut self, peer_id: PeerId, candidate: IceCandidate, ) -> Self::Output

Handles Command::SetIceCandidate variant of Command.

Source

fn on_add_peer_connection_metrics( &mut self, peer_id: PeerId, metrics: PeerMetrics, ) -> Self::Output

Source

fn on_update_tracks( &mut self, peer_id: PeerId, tracks_patches: Vec<TrackPatchCommand>, ) -> Self::Output

Handles Command::UpdateTracks variant of Command.

Source

fn on_synchronize_me(&mut self, state: Room) -> Self::Output

Handles Command::SynchronizeMe variant of Command.

Implementors§