[][src]Struct discord_game_sdk::Discord

pub struct Discord<'a> { /* fields omitted */ }

Main interface with SDK

Methods

impl<'a> Discord<'a>[src]

pub fn new(client_id: i64) -> Result<Self>[src]

pub fn with_create_flags(client_id: i64, flags: CreateFlags) -> Result<Self>[src]

pub fn run_callbacks(&mut self) -> Result<()>[src]

pub fn event_receivers(&self) -> &Receivers[src]

pub fn empty_event_receivers(&self)[src]

impl<'a> Discord<'a>[src]

impl<'a> Discord<'a>[src]

Activities

https://discordapp.com/developers/docs/game-sdk/activities

pub fn register_launch_command(
    &mut self,
    command: impl AsRef<CStr>
) -> Result<()>
[src]

pub fn update_activity(
    &mut self,
    activity: &Activity,
    callback: impl FnMut(&mut Discord, Result<()>) + 'a
)
[src]

pub fn clear_activity(
    &mut self,
    callback: impl FnMut(&mut Discord, Result<()>) + 'a
)
[src]

pub fn send_request_reply(
    &mut self,
    user_id: i64,
    reply: RequestReply,
    callback: impl FnMut(&mut Discord, Result<()>) + 'a
)
[src]

pub fn send_invite(
    &mut self,
    user_id: i64,
    action: Action,
    content: impl AsRef<CStr>,
    callback: impl FnMut(&mut Discord, Result<()>) + 'a
)
[src]

pub fn accept_invite(
    &mut self,
    user_id: i64,
    callback: impl FnMut(&mut Discord, Result<()>) + 'a
)
[src]

impl<'a> Discord<'a>[src]

Application

https://discordapp.com/developers/docs/game-sdk/applications

pub fn current_locale(&mut self) -> String[src]

pub fn current_branch(&mut self) -> String[src]

pub fn validate_or_exit(
    &mut self,
    callback: impl FnMut(&mut Discord, Result<()>) + 'a
)
[src]

pub fn oauth2_token(
    &mut self,
    callback: impl FnMut(&mut Discord, Result<OAuth2Token>) + 'a
)
[src]

pub fn app_ticket(
    &mut self,
    callback: impl FnMut(&mut Discord, Result<String>) + 'a
)
[src]

impl<'a> Discord<'a>[src]

impl<'a> Discord<'a>[src]

pub fn create_lobby(
    &mut self,
    transaction: &LobbyTransaction,
    callback: impl FnMut(&mut Discord, Result<Lobby>) + 'a
)
[src]

pub fn update_lobby(
    &mut self,
    lobby_id: i64,
    transaction: &LobbyTransaction,
    callback: impl FnMut(&mut Discord, Result<()>) + 'a
)
[src]

pub fn delete_lobby(
    &mut self,
    lobby_id: i64,
    callback: impl FnMut(&mut Discord, Result<()>) + 'a
)
[src]

pub fn connect_lobby(
    &mut self,
    lobby_id: i64,
    secret: impl AsRef<CStr>,
    callback: impl FnMut(&mut Discord, Result<Lobby>) + 'a
)
[src]

pub fn connect_lobby_with_activity_secret(
    &mut self,
    activity_secret: impl AsRef<CStr>,
    callback: impl FnMut(&mut Discord, Result<Lobby>) + 'a
)
[src]

pub fn disconnect_lobby(
    &mut self,
    lobby_id: i64,
    callback: impl FnMut(&mut Discord, Result<()>) + 'a
)
[src]

pub fn lobby(&mut self, lobby_id: i64) -> Result<Lobby>[src]

pub fn lobby_activity_secret(&mut self, lobby_id: i64) -> Result<String>[src]

pub fn lobby_metadata(
    &mut self,
    lobby_id: i64,
    key: impl AsRef<CStr>
) -> Result<String>
[src]

pub fn all_lobby_metadata(
    &mut self,
    lobby_id: i64
) -> Result<HashMap<String, String>>
[src]

pub fn update_member(
    &mut self,
    lobby_id: i64,
    user_id: i64,
    transaction: &LobbyMemberTransaction,
    callback: impl FnMut(&mut Discord, Result<()>) + 'a
)
[src]

pub fn all_lobby_member_ids(&mut self, lobby_id: i64) -> Result<Vec<i64>>[src]

pub fn all_lobby_member_metadata(
    &mut self,
    lobby_id: i64,
    user_id: i64
) -> Result<HashMap<String, String>>
[src]

pub fn send_lobby_message(
    &mut self,
    lobby_id: i64,
    buf: impl AsRef<[u8]>,
    callback: impl FnMut(&mut Discord, Result<()>) + 'a
)
[src]

pub fn connect_lobby_voice(
    &mut self,
    lobby_id: i64,
    callback: impl FnMut(&mut Discord, Result<()>) + 'a
)
[src]

pub fn disconnect_lobby_voice(
    &mut self,
    lobby_id: i64,
    callback: impl FnMut(&mut Discord, Result<()>) + 'a
)
[src]

pub fn connect_lobby_network(&mut self, lobby_id: i64) -> Result<()>[src]

pub fn disconnect_lobby_network(&mut self, lobby_id: i64) -> Result<()>[src]

pub fn flush_lobby_network(&mut self) -> Result<()>[src]

pub fn open_lobby_network_channel(
    &mut self,
    lobby_id: i64,
    channel_id: u8,
    reliable: bool
) -> Result<()>
[src]

pub fn send_lobby_network_message(
    &mut self,
    lobby_id: i64,
    user_id: i64,
    channel_id: u8,
    buf: &[u8]
) -> Result<()>
[src]

impl<'a> Discord<'a>[src]

impl<'a> Discord<'a>[src]

impl<'a> Discord<'a>[src]

Relationships

Most methods will return empty/error until event::relationships::Refreshed

https://discordapp.com/developers/docs/game-sdk/relationships

impl<'a> Discord<'a>[src]

pub fn read_file(
    &mut self,
    filename: impl AsRef<CStr>,
    buffer: impl AsMut<[u8]>
) -> Result<u32>
[src]

pub fn read_file_async(
    &mut self,
    filename: impl AsRef<CStr>,
    callback: impl FnMut(&mut Discord, Result<Vec<u8>>) + 'a
)
[src]

pub fn read_file_async_partial(
    &mut self,
    filename: impl AsRef<CStr>,
    offset: u64,
    length: u64,
    callback: impl FnMut(&mut Discord, Result<Vec<u8>>) + 'a
)
[src]

pub fn write_file(
    &mut self,
    filename: impl AsRef<CStr>,
    buffer: impl AsRef<[u8]>
) -> Result<()>
[src]

pub fn write_file_async(
    &mut self,
    filename: impl AsRef<CStr>,
    buffer: impl AsRef<[u8]>,
    callback: impl FnMut(&mut Discord, Result<()>) + 'a
)
[src]

pub fn delete_file(&mut self, filename: impl AsRef<CStr>) -> Result<()>[src]

pub fn file_exists(&mut self, filename: impl AsRef<CStr>) -> Result<bool>[src]

pub fn file_stat(&mut self, filename: impl AsRef<CStr>) -> Result<FileStat>[src]

pub fn all_file_stats(&mut self) -> Result<Vec<FileStat>>[src]

pub fn folder_path(&mut self) -> Result<String>[src]

impl<'a> Discord<'a>[src]

impl<'a> Discord<'a>[src]

impl<'a> Discord<'a>[src]

Trait Implementations

impl<'a> Drop for Discord<'a>[src]

impl<'a> Debug for Discord<'a>[src]

Auto Trait Implementations

impl<'a> !Sync for Discord<'a>

impl<'a> Unpin for Discord<'a>

impl<'a> !Send for Discord<'a>

impl<'a> !UnwindSafe for Discord<'a>

impl<'a> !RefUnwindSafe for Discord<'a>

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]