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§
Required Methods§
Sourcefn on_join_room(
&mut self,
member_id: MemberId,
credential: Credential,
capabilities: Capabilities,
) -> Self::Output
fn on_join_room( &mut self, member_id: MemberId, credential: Credential, capabilities: Capabilities, ) -> Self::Output
Handles Command::JoinRoom
variant of Command
.
Sourcefn on_leave_room(&mut self, member_id: MemberId) -> Self::Output
fn on_leave_room(&mut self, member_id: MemberId) -> Self::Output
Handles Command::LeaveRoom
variant of Command
.
Sourcefn 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_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
.
Sourcefn on_make_sdp_answer(
&mut self,
peer_id: PeerId,
sdp_answer: 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
Handles Command::MakeSdpAnswer
variant of Command
.
Sourcefn on_set_ice_candidate(
&mut self,
peer_id: PeerId,
candidate: IceCandidate,
) -> Self::Output
fn on_set_ice_candidate( &mut self, peer_id: PeerId, candidate: IceCandidate, ) -> Self::Output
Handles Command::SetIceCandidate
variant of Command
.
Sourcefn on_add_peer_connection_metrics(
&mut self,
peer_id: PeerId,
metrics: PeerMetrics,
) -> Self::Output
fn on_add_peer_connection_metrics( &mut self, peer_id: PeerId, metrics: PeerMetrics, ) -> Self::Output
Handles Command::AddPeerConnectionMetrics
variant of Command
.
Sourcefn on_update_tracks(
&mut self,
peer_id: PeerId,
tracks_patches: Vec<TrackPatchCommand>,
) -> Self::Output
fn on_update_tracks( &mut self, peer_id: PeerId, tracks_patches: Vec<TrackPatchCommand>, ) -> Self::Output
Handles Command::UpdateTracks
variant of Command
.
Sourcefn on_synchronize_me(&mut self, state: Room) -> Self::Output
fn on_synchronize_me(&mut self, state: Room) -> Self::Output
Handles Command::SynchronizeMe
variant of Command
.