Trait EventHandler

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

Source

type Output

Output type of all functions from this trait.

Required Methods§

Source

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.

Source

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.

Source

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.

Source

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.

Source

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,

Source

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,

Source

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.

Source

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.

Source

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,

Source

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.

Implementors§