[−][src]Struct discord_game_sdk::Discord
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]
pub fn set_achievement(
&mut self,
achievement_id: i64,
percent_complete: i64,
callback: impl FnMut(&mut Discord, Result<()>) + 'a
)
[src]
&mut self,
achievement_id: i64,
percent_complete: i64,
callback: impl FnMut(&mut Discord, Result<()>) + 'a
)
percent_complete
must be [0..=100]
https://discordapp.com/developers/docs/game-sdk/achievements#setuserachievement
pub fn fetch_achievements(
&mut self,
callback: impl FnMut(&mut Discord, Result<()>) + 'a
)
[src]
&mut self,
callback: impl FnMut(&mut Discord, Result<()>) + 'a
)
pub fn achievement(&mut self, achievement_id: i64) -> Result<Achievement>
[src]
pub fn all_achievements(&mut self) -> Result<Vec<Achievement>>
[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]
&mut self,
command: impl AsRef<CStr>
) -> Result<()>
command
must also be valid UTF-8
https://discordapp.com/developers/docs/game-sdk/activities#registercommand
pub fn update_activity(
&mut self,
activity: &Activity,
callback: impl FnMut(&mut Discord, Result<()>) + 'a
)
[src]
&mut self,
activity: &Activity,
callback: impl FnMut(&mut Discord, Result<()>) + 'a
)
pub fn clear_activity(
&mut self,
callback: impl FnMut(&mut Discord, Result<()>) + 'a
)
[src]
&mut self,
callback: impl FnMut(&mut Discord, Result<()>) + 'a
)
pub fn send_request_reply(
&mut self,
user_id: i64,
reply: RequestReply,
callback: impl FnMut(&mut Discord, Result<()>) + 'a
)
[src]
&mut self,
user_id: i64,
reply: RequestReply,
callback: impl FnMut(&mut Discord, Result<()>) + 'a
)
pub fn send_invite(
&mut self,
user_id: i64,
action: Action,
content: impl AsRef<CStr>,
callback: impl FnMut(&mut Discord, Result<()>) + 'a
)
[src]
&mut self,
user_id: i64,
action: Action,
content: impl AsRef<CStr>,
callback: impl FnMut(&mut Discord, Result<()>) + 'a
)
content
must also be valid UTF-8
https://discordapp.com/developers/docs/game-sdk/activities#sendinvite
pub fn accept_invite(
&mut self,
user_id: i64,
callback: impl FnMut(&mut Discord, Result<()>) + 'a
)
[src]
&mut self,
user_id: i64,
callback: impl FnMut(&mut Discord, Result<()>) + 'a
)
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]
&mut self,
callback: impl FnMut(&mut Discord, Result<()>) + 'a
)
pub fn oauth2_token(
&mut self,
callback: impl FnMut(&mut Discord, Result<OAuth2Token>) + 'a
)
[src]
&mut self,
callback: impl FnMut(&mut Discord, Result<OAuth2Token>) + 'a
)
pub fn app_ticket(
&mut self,
callback: impl FnMut(&mut Discord, Result<String>) + 'a
)
[src]
&mut self,
callback: impl FnMut(&mut Discord, Result<String>) + 'a
)
impl<'a> Discord<'a>
[src]
pub fn fetch_image(
&mut self,
handle: ImageHandle,
refresh: FetchKind,
callback: impl FnMut(&mut Discord, Result<ImageHandle>) + 'a
)
[src]
&mut self,
handle: ImageHandle,
refresh: FetchKind,
callback: impl FnMut(&mut Discord, Result<ImageHandle>) + 'a
)
pub fn image_dimensions(&mut self, handle: ImageHandle) -> Result<(u32, u32)>
[src]
pub fn image(&mut self, handle: ImageHandle) -> Result<Image>
[src]
impl<'a> Discord<'a>
[src]
pub fn create_lobby(
&mut self,
transaction: &LobbyTransaction,
callback: impl FnMut(&mut Discord, Result<Lobby>) + 'a
)
[src]
&mut self,
transaction: &LobbyTransaction,
callback: impl FnMut(&mut Discord, Result<Lobby>) + 'a
)
pub fn update_lobby(
&mut self,
lobby_id: i64,
transaction: &LobbyTransaction,
callback: impl FnMut(&mut Discord, Result<()>) + 'a
)
[src]
&mut self,
lobby_id: i64,
transaction: &LobbyTransaction,
callback: impl FnMut(&mut Discord, Result<()>) + 'a
)
pub fn delete_lobby(
&mut self,
lobby_id: i64,
callback: impl FnMut(&mut Discord, Result<()>) + 'a
)
[src]
&mut self,
lobby_id: i64,
callback: impl FnMut(&mut Discord, Result<()>) + 'a
)
pub fn connect_lobby(
&mut self,
lobby_id: i64,
secret: impl AsRef<CStr>,
callback: impl FnMut(&mut Discord, Result<Lobby>) + 'a
)
[src]
&mut self,
lobby_id: i64,
secret: impl AsRef<CStr>,
callback: impl FnMut(&mut Discord, Result<Lobby>) + 'a
)
secret
must also be valid UTF-8
https://discordapp.com/developers/docs/game-sdk/lobbies#connectlobby
pub fn connect_lobby_with_activity_secret(
&mut self,
activity_secret: impl AsRef<CStr>,
callback: impl FnMut(&mut Discord, Result<Lobby>) + 'a
)
[src]
&mut self,
activity_secret: impl AsRef<CStr>,
callback: impl FnMut(&mut Discord, Result<Lobby>) + 'a
)
activity_secret
must also be valid UTF-8
https://discordapp.com/developers/docs/game-sdk/lobbies#connectlobbywithactivitysecret
pub fn disconnect_lobby(
&mut self,
lobby_id: i64,
callback: impl FnMut(&mut Discord, Result<()>) + 'a
)
[src]
&mut self,
lobby_id: i64,
callback: impl FnMut(&mut Discord, Result<()>) + 'a
)
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]
&mut self,
lobby_id: i64,
key: impl AsRef<CStr>
) -> Result<String>
key
must also be valid UTF-8
https://discordapp.com/developers/docs/game-sdk/lobbies#getlobbymetadatavalue
pub fn all_lobby_metadata(
&mut self,
lobby_id: i64
) -> Result<HashMap<String, String>>
[src]
&mut self,
lobby_id: i64
) -> Result<HashMap<String, String>>
https://discordapp.com/developers/docs/game-sdk/lobbies#lobbymetadatacount
https://discordapp.com/developers/docs/game-sdk/lobbies#getlobbymetadatakey
https://discordapp.com/developers/docs/game-sdk/lobbies#getlobbymetadatavalue
pub fn update_member(
&mut self,
lobby_id: i64,
user_id: i64,
transaction: &LobbyMemberTransaction,
callback: impl FnMut(&mut Discord, Result<()>) + 'a
)
[src]
&mut self,
lobby_id: i64,
user_id: i64,
transaction: &LobbyMemberTransaction,
callback: impl FnMut(&mut Discord, Result<()>) + 'a
)
pub fn all_lobby_member_ids(&mut self, lobby_id: i64) -> Result<Vec<i64>>
[src]
https://discordapp.com/developers/docs/game-sdk/lobbies#membercount
https://discordapp.com/developers/docs/game-sdk/lobbies#getmemberuserid
pub fn all_lobby_member_metadata(
&mut self,
lobby_id: i64,
user_id: i64
) -> Result<HashMap<String, String>>
[src]
&mut self,
lobby_id: i64,
user_id: i64
) -> Result<HashMap<String, String>>
https://discordapp.com/developers/docs/game-sdk/lobbies#membermetadatacount
https://discordapp.com/developers/docs/game-sdk/lobbies#getmembermetadatakey
https://discordapp.com/developers/docs/game-sdk/lobbies#getmembermetadatavalue
pub fn send_lobby_message(
&mut self,
lobby_id: i64,
buf: impl AsRef<[u8]>,
callback: impl FnMut(&mut Discord, Result<()>) + 'a
)
[src]
&mut self,
lobby_id: i64,
buf: impl AsRef<[u8]>,
callback: impl FnMut(&mut Discord, Result<()>) + 'a
)
pub fn lobby_search(
&mut self,
search: &SearchQuery,
callback: impl FnMut(&mut Discord, Result<Vec<i64>>) + 'a
)
[src]
&mut self,
search: &SearchQuery,
callback: impl FnMut(&mut Discord, Result<Vec<i64>>) + 'a
)
pub fn connect_lobby_voice(
&mut self,
lobby_id: i64,
callback: impl FnMut(&mut Discord, Result<()>) + 'a
)
[src]
&mut self,
lobby_id: i64,
callback: impl FnMut(&mut Discord, Result<()>) + 'a
)
pub fn disconnect_lobby_voice(
&mut self,
lobby_id: i64,
callback: impl FnMut(&mut Discord, Result<()>) + 'a
)
[src]
&mut self,
lobby_id: i64,
callback: impl FnMut(&mut Discord, Result<()>) + 'a
)
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]
&mut self,
lobby_id: i64,
channel_id: u8,
reliable: bool
) -> Result<()>
pub fn send_lobby_network_message(
&mut self,
lobby_id: i64,
user_id: i64,
channel_id: u8,
buf: &[u8]
) -> Result<()>
[src]
&mut self,
lobby_id: i64,
user_id: i64,
channel_id: u8,
buf: &[u8]
) -> Result<()>
impl<'a> Discord<'a>
[src]
pub fn peer_id(&mut self) -> u64
[src]
pub fn flush_network(&mut self) -> Result<()>
[src]
pub fn open_peer(&mut self, peer_id: u64, route: impl AsRef<CStr>) -> Result<()>
[src]
route
must also be valid UTF-8
https://discordapp.com/developers/docs/game-sdk/networking#openpeer
pub fn update_peer(
&mut self,
peer_id: u64,
route: impl AsRef<CStr>
) -> Result<()>
[src]
&mut self,
peer_id: u64,
route: impl AsRef<CStr>
) -> Result<()>
route
must also be valid UTF-8
https://discordapp.com/developers/docs/game-sdk/networking#updatepeer
pub fn close_peer(&mut self, peer_id: u64) -> Result<()>
[src]
pub fn open_channel(
&mut self,
peer_id: u64,
chan_id: u8,
reliable: Reliability
) -> Result<()>
[src]
&mut self,
peer_id: u64,
chan_id: u8,
reliable: Reliability
) -> Result<()>
pub fn close_channel(&mut self, peer_id: u64, chan_id: u8) -> Result<()>
[src]
pub fn send_message(
&mut self,
peer_id: u64,
chan_id: u8,
buf: impl AsRef<[u8]>
) -> Result<()>
[src]
&mut self,
peer_id: u64,
chan_id: u8,
buf: impl AsRef<[u8]>
) -> Result<()>
impl<'a> Discord<'a>
[src]
pub fn overlay_enabled(&mut self) -> bool
[src]
pub fn overlay_opened(&mut self) -> bool
[src]
pub fn set_overlay_opened(
&mut self,
opened: bool,
callback: impl FnMut(&mut Discord, Result<()>) + 'a
)
[src]
&mut self,
opened: bool,
callback: impl FnMut(&mut Discord, Result<()>) + 'a
)
pub fn open_invite_overlay(
&mut self,
action: Action,
callback: impl FnMut(&mut Discord, Result<()>) + 'a
)
[src]
&mut self,
action: Action,
callback: impl FnMut(&mut Discord, Result<()>) + 'a
)
pub fn open_guild_invite_overlay(
&mut self,
code: impl AsRef<CStr>,
callback: impl FnMut(&mut Discord, Result<()>) + 'a
)
[src]
&mut self,
code: impl AsRef<CStr>,
callback: impl FnMut(&mut Discord, Result<()>) + 'a
)
code
must be valid UTF-8
https://discordapp.com/developers/docs/game-sdk/overlay#openguildinvite
pub fn open_voice_settings(
&mut self,
callback: impl FnMut(&mut Discord, Result<()>) + 'a
)
[src]
&mut self,
callback: impl FnMut(&mut Discord, Result<()>) + 'a
)
impl<'a> Discord<'a>
[src]
Relationships
Most methods will return empty/error until event::relationships::Refreshed
https://discordapp.com/developers/docs/game-sdk/relationships
pub fn relationship_with(&mut self, user_id: i64) -> Result<Relationship>
[src]
pub fn all_relationships<F: FnMut(Relationship) -> bool>(
&mut self,
filter: F
) -> Result<Vec<Relationship>>
[src]
&mut self,
filter: F
) -> Result<Vec<Relationship>>
impl<'a> Discord<'a>
[src]
pub fn read_file(
&mut self,
filename: impl AsRef<CStr>,
buffer: impl AsMut<[u8]>
) -> Result<u32>
[src]
&mut self,
filename: impl AsRef<CStr>,
buffer: impl AsMut<[u8]>
) -> Result<u32>
filename
must also be valid UTF-8
https://discordapp.com/developers/docs/game-sdk/storage#read
pub fn read_file_async(
&mut self,
filename: impl AsRef<CStr>,
callback: impl FnMut(&mut Discord, Result<Vec<u8>>) + 'a
)
[src]
&mut self,
filename: impl AsRef<CStr>,
callback: impl FnMut(&mut Discord, Result<Vec<u8>>) + 'a
)
filename
must also be valid UTF-8
https://discordapp.com/developers/docs/game-sdk/storage#readasync
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]
&mut self,
filename: impl AsRef<CStr>,
offset: u64,
length: u64,
callback: impl FnMut(&mut Discord, Result<Vec<u8>>) + 'a
)
filename
must also be valid UTF-8
https://discordapp.com/developers/docs/game-sdk/storage#readasyncpartial
pub fn write_file(
&mut self,
filename: impl AsRef<CStr>,
buffer: impl AsRef<[u8]>
) -> Result<()>
[src]
&mut self,
filename: impl AsRef<CStr>,
buffer: impl AsRef<[u8]>
) -> Result<()>
filename
must also be valid UTF-8
https://discordapp.com/developers/docs/game-sdk/storage#write
pub fn write_file_async(
&mut self,
filename: impl AsRef<CStr>,
buffer: impl AsRef<[u8]>,
callback: impl FnMut(&mut Discord, Result<()>) + 'a
)
[src]
&mut self,
filename: impl AsRef<CStr>,
buffer: impl AsRef<[u8]>,
callback: impl FnMut(&mut Discord, Result<()>) + 'a
)
filename
must also be valid UTF-8
https://discordapp.com/developers/docs/game-sdk/storage#writeasync
pub fn delete_file(&mut self, filename: impl AsRef<CStr>) -> Result<()>
[src]
filename
must also be valid UTF-8
https://discordapp.com/developers/docs/game-sdk/storage#delete
pub fn file_exists(&mut self, filename: impl AsRef<CStr>) -> Result<bool>
[src]
filename
must also be valid UTF-8
https://discordapp.com/developers/docs/game-sdk/storage#exists
pub fn file_stat(&mut self, filename: impl AsRef<CStr>) -> Result<FileStat>
[src]
filename
must also be valid UTF-8
https://discordapp.com/developers/docs/game-sdk/storage#stat
pub fn all_file_stats(&mut self) -> Result<Vec<FileStat>>
[src]
https://discordapp.com/developers/docs/game-sdk/storage#statat
https://discordapp.com/developers/docs/game-sdk/storage#count
pub fn folder_path(&mut self) -> Result<String>
[src]
impl<'a> Discord<'a>
[src]
pub fn fetch_skus(
&mut self,
callback: impl FnMut(&mut Discord, Result<()>) + 'a
)
[src]
&mut self,
callback: impl FnMut(&mut Discord, Result<()>) + 'a
)
pub fn sku(&mut self, id: i64) -> Result<Sku>
[src]
pub fn all_skus(&mut self) -> Result<Vec<Sku>>
[src]
https://discordapp.com/developers/docs/game-sdk/store#getskuat
https://discordapp.com/developers/docs/game-sdk/store#countskus
pub fn entitlement(&mut self, id: i64) -> Result<Entitlement>
[src]
pub fn all_entitlements(&mut self) -> Result<Vec<Entitlement>>
[src]
https://discordapp.com/developers/docs/game-sdk/store#getentitlementat
https://discordapp.com/developers/docs/game-sdk/store#countentitlements
pub fn has_entitlement(&mut self, sku_id: i64) -> Result<bool>
[src]
pub fn start_purchase(
&mut self,
sku_id: i64,
callback: impl FnMut(&mut Discord, Result<()>) + 'a
)
[src]
&mut self,
sku_id: i64,
callback: impl FnMut(&mut Discord, Result<()>) + 'a
)
impl<'a> Discord<'a>
[src]
pub fn current_user(&mut self) -> Result<User>
[src]
Get Current User
Will return Err(_) until event::user::CurrentUserUpdate
https://discordapp.com/developers/docs/game-sdk/users#getcurrentuser
pub fn user(
&mut self,
user_id: i64,
callback: impl FnMut(&mut Discord, Result<User>) + 'a
)
[src]
&mut self,
user_id: i64,
callback: impl FnMut(&mut Discord, Result<User>) + 'a
)
pub fn current_user_premium_kind(&mut self) -> Result<PremiumKind>
[src]
pub fn current_user_flags(&mut self) -> Result<UserFlags>
[src]
impl<'a> Discord<'a>
[src]
pub fn input_mode(&mut self) -> Result<InputMode>
[src]
pub fn set_input_mode(
&mut self,
input_mode: InputMode,
callback: impl FnMut(&mut Discord, Result<()>) + 'a
)
[src]
&mut self,
input_mode: InputMode,
callback: impl FnMut(&mut Discord, Result<()>) + 'a
)
pub fn self_muted(&mut self) -> Result<bool>
[src]
pub fn self_deafened(&mut self) -> Result<bool>
[src]
pub fn set_self_mute(&mut self, muted: bool) -> Result<()>
[src]
pub fn set_self_deaf(&mut self, deafened: bool) -> Result<()>
[src]
pub fn local_muted(&mut self, user_id: i64) -> Result<bool>
[src]
pub fn local_volume(&mut self, user_id: i64) -> Result<u8>
[src]
pub fn set_local_mute(&mut self, user_id: i64, muted: bool) -> Result<()>
[src]
pub fn set_local_volume(&mut self, user_id: i64, volume: u8) -> Result<()>
[src]
Trait Implementations
Auto Trait Implementations
impl<'a> !Sync for Discord<'a>
impl<'a> !Send for Discord<'a>
impl<'a> Unpin for Discord<'a>
impl<'a> !RefUnwindSafe for Discord<'a>
impl<'a> !UnwindSafe for Discord<'a>
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,