[][src]Trait discord_game_sdk::EventHandler

pub trait EventHandler: Sized {
    fn on_user_achievement_update(
        &mut self,
        discord: &Discord<Self>,
        user_achievement: &UserAchievement
    ) { ... }
fn on_activity_join(&mut self, discord: &Discord<Self>, secret: &str) { ... }
fn on_activity_spectate(&mut self, discord: &Discord<Self>, secret: &str) { ... }
fn on_activity_join_request(&mut self, discord: &Discord<Self>, user: &User) { ... }
fn on_activity_invite(
        &mut self,
        discord: &Discord<Self>,
        kind: Action,
        user: &User,
        activity: &Activity
    ) { ... }
fn on_lobby_update(&mut self, discord: &Discord<Self>, lobby_id: LobbyID) { ... }
fn on_lobby_delete(
        &mut self,
        discord: &Discord<Self>,
        lobby_id: LobbyID,
        reason: u32
    ) { ... }
fn on_member_connect(
        &mut self,
        discord: &Discord<Self>,
        lobby_id: LobbyID,
        member_id: UserID
    ) { ... }
fn on_member_update(
        &mut self,
        discord: &Discord<Self>,
        lobby_id: LobbyID,
        member_id: UserID
    ) { ... }
fn on_member_disconnect(
        &mut self,
        discord: &Discord<Self>,
        lobby_id: LobbyID,
        member_id: UserID
    ) { ... }
fn on_lobby_message(
        &mut self,
        discord: &Discord<Self>,
        lobby_id: LobbyID,
        member_id: UserID,
        data: &[u8]
    ) { ... }
fn on_speaking(
        &mut self,
        discord: &Discord<Self>,
        lobby_id: LobbyID,
        member_id: UserID,
        speaking: bool
    ) { ... }
fn on_lobby_network_message(
        &mut self,
        discord: &Discord<Self>,
        lobby_id: LobbyID,
        member_id: UserID,
        channel_id: NetworkChannelID,
        data: &[u8]
    ) { ... }
fn on_network_message(
        &mut self,
        discord: &Discord<Self>,
        peer_id: NetworkPeerID,
        channel_id: NetworkChannelID,
        data: &[u8]
    ) { ... }
fn on_network_route_update(&mut self, discord: &Discord<Self>, route: &str) { ... }
fn on_overlay_toggle(&mut self, discord: &Discord<Self>, closed: bool) { ... }
fn on_relationships_refresh(&mut self, discord: &Discord<Self>) { ... }
fn on_relationship_update(
        &mut self,
        discord: &Discord<Self>,
        relationship: &Relationship
    ) { ... }
fn on_entitlement_create(
        &mut self,
        discord: &Discord<Self>,
        entitlement: &Entitlement
    ) { ... }
fn on_entitlement_delete(
        &mut self,
        discord: &Discord<Self>,
        entitlement: &Entitlement
    ) { ... }
fn on_current_user_update(&mut self, discord: &Discord<Self>) { ... }
fn on_voice_settings_update(&mut self, discord: &Discord<Self>) { ... } }

Trait providing callbacks for the SDK.

All methods have a default empty implementation.

Provided methods

fn on_user_achievement_update(
    &mut self,
    discord: &Discord<Self>,
    user_achievement: &UserAchievement
)

Fired when an User Achievement is updated

Method in official docs

fn on_activity_join(&mut self, discord: &Discord<Self>, secret: &str)

Fired when the current user accepts an invitation to join in chat or receives confirmation from Asking to Join.

Method in official docs

fn on_activity_spectate(&mut self, discord: &Discord<Self>, secret: &str)

Fired when the current user accepts an invitation to spectate in chat or clicks the Spectate button on another user's profile.

Method in official docs

fn on_activity_join_request(&mut self, discord: &Discord<Self>, user: &User)

Fires when a user asks to join the game of the current user.

Method in official docs

fn on_activity_invite(
    &mut self,
    discord: &Discord<Self>,
    kind: Action,
    user: &User,
    activity: &Activity
)

Fires when the current user receives an invitation to join or spectate.

Method in official docs

fn on_lobby_update(&mut self, discord: &Discord<Self>, lobby_id: LobbyID)

Fires when a lobby is updated.

Method in official docs

fn on_lobby_delete(
    &mut self,
    discord: &Discord<Self>,
    lobby_id: LobbyID,
    reason: u32
)

Fired when a lobby is deleted.

Method in official docs

fn on_member_connect(
    &mut self,
    discord: &Discord<Self>,
    lobby_id: LobbyID,
    member_id: UserID
)

Fires when a member joins the lobby.

Method in official docs

fn on_member_update(
    &mut self,
    discord: &Discord<Self>,
    lobby_id: LobbyID,
    member_id: UserID
)

Fires when data for a lobby member is updated.

Method in official docs

fn on_member_disconnect(
    &mut self,
    discord: &Discord<Self>,
    lobby_id: LobbyID,
    member_id: UserID
)

Fires when a member leaves the lobby.

Method in official docs

fn on_lobby_message(
    &mut self,
    discord: &Discord<Self>,
    lobby_id: LobbyID,
    member_id: UserID,
    data: &[u8]
)

Fires when a message is sent to the lobby.

Method in official docs

fn on_speaking(
    &mut self,
    discord: &Discord<Self>,
    lobby_id: LobbyID,
    member_id: UserID,
    speaking: bool
)

Fires when a user connected to voice starts or stops speaking.

Method in official docs

fn on_lobby_network_message(
    &mut self,
    discord: &Discord<Self>,
    lobby_id: LobbyID,
    member_id: UserID,
    channel_id: NetworkChannelID,
    data: &[u8]
)

Fires when the user receives a message from the lobby's networking layer.

Method in official docs

fn on_network_message(
    &mut self,
    discord: &Discord<Self>,
    peer_id: NetworkPeerID,
    channel_id: NetworkChannelID,
    data: &[u8]
)

Fires when you receive data from another user.

This callback will only fire if you already have an open channel with the user sending you data.

Method in official docs

fn on_network_route_update(&mut self, discord: &Discord<Self>, route: &str)

Fires when your networking route has changed.

You should broadcast this change to other users.

Method in official docs

fn on_overlay_toggle(&mut self, discord: &Discord<Self>, closed: bool)

Fires when the overlay is opened or closed.

Method in official docs

fn on_relationships_refresh(&mut self, discord: &Discord<Self>)

Fires at initialization when Discord<'_, Self> has cached a snapshot of all your relationships.

Method in official docs

fn on_relationship_update(
    &mut self,
    discord: &Discord<Self>,
    relationship: &Relationship
)

Fires when a relationship in the filtered list changes, like an updated presence or user attribute.

Method in official docs

fn on_entitlement_create(
    &mut self,
    discord: &Discord<Self>,
    entitlement: &Entitlement
)

Fires when the connected user receives a new entitlement, either through purchase or through a developer grant.

Method in official docs

fn on_entitlement_delete(
    &mut self,
    discord: &Discord<Self>,
    entitlement: &Entitlement
)

Fires when the connected user loses an entitlement, either by expiration, revocation, or consumption in the case of consumable entitlements.

Method in official docs

fn on_current_user_update(&mut self, discord: &Discord<Self>)

Fires when the User struct of the currently connected user changes.

Method in official docs

fn on_voice_settings_update(&mut self, discord: &Discord<Self>)

Fires when the current user has updated their voice settings.

Loading content...

Implementations on Foreign Types

impl EventHandler for ()[src]

Empty implementation

Loading content...

Implementors

Loading content...