Struct activity::DiscordSDK

source ·
pub struct DiscordSDK { /* private fields */ }

Implementations§

source§

impl DiscordSDK

source

pub fn new(client_id: &str) -> Result<Self, JsValue>

source

pub fn client_id(&self) -> String

source

pub fn instance_id(&self) -> String

source

pub fn platform(&self) -> String

source

pub fn guild_id(&self) -> Option<String>

source

pub fn channel_id(&self) -> Option<String>

source

pub fn configuration(&self) -> SdkConfiguration

source

pub async fn ready(&self) -> Result<(), JsValue>

source

pub async fn subscribe<F, T>( &self, f: F, args: SubscribeArgs ) -> Result<EventSubscription, JsValue>
where T: DeserializeOwned + EventPayload, F: FnMut(T) -> Result<(), JsValue> + 'static,

source

pub async fn unsubscribe(&self, event: &str) -> Result<(), JsValue>

source

pub fn unsubscribe_nowait(&self, event: &str)

source

pub async fn authenticate( &self, args: AuthenticateArgs ) -> Result<AuthenticateRes, JsValue>

source

pub async fn authorize( &self, args: AuthorizeArgs ) -> Result<AuthorizeRes, JsValue>

source

pub async fn capture_log(&self, args: CaputeLogArgs) -> Result<(), JsValue>

source

pub async fn encourage_hardware_acceleration(&self) -> Result<(), JsValue>

source

pub async fn get_channel( &self, args: GetChannelArgs ) -> Result<GetChannelRes, JsValue>

source

pub async fn get_channel_permissions( &self ) -> Result<GetChannelPermissionsRes, JsValue>

source

pub async fn get_instance_connected_participants( &self ) -> Result<GetInstanceConnectedParticipantsRes, JsValue>

source

pub async fn get_platform_behaviors( &self ) -> Result<GetPlatformBehaviorsRes, JsValue>

source

pub async fn initiate_image_upload( &self ) -> Result<InitiateImageUploadRes, JsValue>

source

pub async fn open_invite_dialog(&self) -> Result<(), JsValue>

source

pub async fn open_share_moment_dialog( &self, args: OpenShareMomentDialogArgs ) -> Result<(), JsValue>

source

pub async fn set_activity(&self, args: JsValue) -> Result<(), JsValue>

source

pub async fn set_config(&self, args: SetConfigArgs) -> Result<(), JsValue>

source

pub async fn set_orientation_lock_state( &self, args: SetOrientationLockStateArgs ) -> Result<(), JsValue>

source

pub async fn user_settings_get_locale( &self ) -> Result<UserSettingsGetLocaleRes, JsValue>

Trait Implementations§

source§

impl Clone for DiscordSDK

source§

fn clone(&self) -> DiscordSDK

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.