pub trait EventHandler {
type Output;
// Required methods
fn on_room_joined<'life0, 'async_trait>(
&'life0 self,
member_id: MemberId,
) -> Pin<Box<dyn Future<Output = Self::Output> + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn on_room_left<'life0, 'async_trait>(
&'life0 self,
close_reason: CloseReason,
) -> Pin<Box<dyn Future<Output = Self::Output> + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn on_peer_created<'life0, 'async_trait>(
&'life0 self,
peer_id: PeerId,
negotiation_role: NegotiationRole,
connection_mode: ConnectionMode,
tracks: Vec<Track>,
ice_servers: Vec<IceServer>,
force_relay: bool,
) -> Pin<Box<dyn Future<Output = Self::Output> + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn on_sdp_answer_made<'life0, 'async_trait>(
&'life0 self,
peer_id: PeerId,
sdp_answer: String,
) -> Pin<Box<dyn Future<Output = Self::Output> + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn on_local_description_applied<'life0, 'async_trait>(
&'life0 self,
peer_id: PeerId,
sdp_offer: String,
) -> Pin<Box<dyn Future<Output = Self::Output> + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn on_ice_candidate_discovered<'life0, 'async_trait>(
&'life0 self,
peer_id: PeerId,
candidate: IceCandidate,
) -> Pin<Box<dyn Future<Output = Self::Output> + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn on_peers_removed<'life0, 'async_trait>(
&'life0 self,
peer_ids: Vec<PeerId>,
) -> Pin<Box<dyn Future<Output = Self::Output> + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn on_peer_updated<'life0, 'async_trait>(
&'life0 self,
peer_id: PeerId,
updates: Vec<PeerUpdate>,
negotiation_role: Option<NegotiationRole>,
) -> Pin<Box<dyn Future<Output = Self::Output> + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn on_connection_quality_updated<'life0, 'async_trait>(
&'life0 self,
partner_member_id: MemberId,
quality_score: ConnectionQualityScore,
) -> Pin<Box<dyn Future<Output = Self::Output> + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn on_state_synchronized<'life0, 'async_trait>(
&'life0 self,
state: Room,
) -> Pin<Box<dyn Future<Output = Self::Output> + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}
Expand description
Handler of Event
variants.
Using Event::dispatch_with
method dispatches Event
variants to appropriate methods of this trait.
Required Associated Types§
Required Methods§
Sourcefn on_room_joined<'life0, 'async_trait>(
&'life0 self,
member_id: MemberId,
) -> Pin<Box<dyn Future<Output = Self::Output> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn on_room_joined<'life0, 'async_trait>(
&'life0 self,
member_id: MemberId,
) -> Pin<Box<dyn Future<Output = Self::Output> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handles Event::RoomJoined
variant of Event
.
Sourcefn on_room_left<'life0, 'async_trait>(
&'life0 self,
close_reason: CloseReason,
) -> Pin<Box<dyn Future<Output = Self::Output> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn on_room_left<'life0, 'async_trait>(
&'life0 self,
close_reason: CloseReason,
) -> Pin<Box<dyn Future<Output = Self::Output> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handles Event::RoomLeft
variant of Event
.
Sourcefn on_peer_created<'life0, 'async_trait>(
&'life0 self,
peer_id: PeerId,
negotiation_role: NegotiationRole,
connection_mode: ConnectionMode,
tracks: Vec<Track>,
ice_servers: Vec<IceServer>,
force_relay: bool,
) -> Pin<Box<dyn Future<Output = Self::Output> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn on_peer_created<'life0, 'async_trait>(
&'life0 self,
peer_id: PeerId,
negotiation_role: NegotiationRole,
connection_mode: ConnectionMode,
tracks: Vec<Track>,
ice_servers: Vec<IceServer>,
force_relay: bool,
) -> Pin<Box<dyn Future<Output = Self::Output> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handles Event::PeerCreated
variant of Event
.
Sourcefn on_sdp_answer_made<'life0, 'async_trait>(
&'life0 self,
peer_id: PeerId,
sdp_answer: String,
) -> Pin<Box<dyn Future<Output = Self::Output> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn on_sdp_answer_made<'life0, 'async_trait>(
&'life0 self,
peer_id: PeerId,
sdp_answer: String,
) -> Pin<Box<dyn Future<Output = Self::Output> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handles Event::SdpAnswerMade
variant of Event
.
Sourcefn on_local_description_applied<'life0, 'async_trait>(
&'life0 self,
peer_id: PeerId,
sdp_offer: String,
) -> Pin<Box<dyn Future<Output = Self::Output> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn on_local_description_applied<'life0, 'async_trait>(
&'life0 self,
peer_id: PeerId,
sdp_offer: String,
) -> Pin<Box<dyn Future<Output = Self::Output> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handles Event::LocalDescriptionApplied
variant of Event
.
Sourcefn on_ice_candidate_discovered<'life0, 'async_trait>(
&'life0 self,
peer_id: PeerId,
candidate: IceCandidate,
) -> Pin<Box<dyn Future<Output = Self::Output> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn on_ice_candidate_discovered<'life0, 'async_trait>(
&'life0 self,
peer_id: PeerId,
candidate: IceCandidate,
) -> Pin<Box<dyn Future<Output = Self::Output> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handles Event::IceCandidateDiscovered
variant of Event
.
Sourcefn on_peers_removed<'life0, 'async_trait>(
&'life0 self,
peer_ids: Vec<PeerId>,
) -> Pin<Box<dyn Future<Output = Self::Output> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn on_peers_removed<'life0, 'async_trait>(
&'life0 self,
peer_ids: Vec<PeerId>,
) -> Pin<Box<dyn Future<Output = Self::Output> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handles Event::PeersRemoved
variant of Event
.
Sourcefn on_peer_updated<'life0, 'async_trait>(
&'life0 self,
peer_id: PeerId,
updates: Vec<PeerUpdate>,
negotiation_role: Option<NegotiationRole>,
) -> Pin<Box<dyn Future<Output = Self::Output> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn on_peer_updated<'life0, 'async_trait>(
&'life0 self,
peer_id: PeerId,
updates: Vec<PeerUpdate>,
negotiation_role: Option<NegotiationRole>,
) -> Pin<Box<dyn Future<Output = Self::Output> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handles Event::PeerUpdated
variant of Event
.
Sourcefn on_connection_quality_updated<'life0, 'async_trait>(
&'life0 self,
partner_member_id: MemberId,
quality_score: ConnectionQualityScore,
) -> Pin<Box<dyn Future<Output = Self::Output> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn on_connection_quality_updated<'life0, 'async_trait>(
&'life0 self,
partner_member_id: MemberId,
quality_score: ConnectionQualityScore,
) -> Pin<Box<dyn Future<Output = Self::Output> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handles Event::ConnectionQualityUpdated
variant of Event
.
Sourcefn on_state_synchronized<'life0, 'async_trait>(
&'life0 self,
state: Room,
) -> Pin<Box<dyn Future<Output = Self::Output> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn on_state_synchronized<'life0, 'async_trait>(
&'life0 self,
state: Room,
) -> Pin<Box<dyn Future<Output = Self::Output> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handles Event::StateSynchronized
variant of Event
.