pub struct DiscordIPCSync { /* private fields */ }Implementations§
Source§impl DiscordIPCSync
impl DiscordIPCSync
Sourcepub fn new(client_id: &str) -> Result<Self>
pub fn new(client_id: &str) -> Result<Self>
Creates a new Discord IPC client instance.
Examples found in repository?
More examples
Sourcepub fn client_id(&self) -> String
pub fn client_id(&self) -> String
The Discord client ID that has been used to initialize this IPC client instance.
Sourcepub fn run(&mut self) -> Result<()>
pub fn run(&mut self) -> Result<()>
Run the client.
Must be called before any [set_activity()] calls.
Examples found in repository?
More examples
Sourcepub fn wait(&mut self) -> Result<()>
pub fn wait(&mut self) -> Result<()>
Waits for the IPC task to finish.
[run()] must be called to spawn it in the first place.
Sourcepub fn set_activity(&self, details: &str, state: &str) -> Result<()>
pub fn set_activity(&self, details: &str, state: &str) -> Result<()>
Sets/updates the Discord Rich presence activity.
[run()] must be executed prior to calling this.
Examples found in repository?
More examples
Sourcepub fn clear_activity(&self) -> Result<()>
pub fn clear_activity(&self) -> Result<()>
Clears a previously set Discord Rich Presence activity.
Trait Implementations§
Source§impl Debug for DiscordIPCSync
impl Debug for DiscordIPCSync
Auto Trait Implementations§
impl !Freeze for DiscordIPCSync
impl RefUnwindSafe for DiscordIPCSync
impl Send for DiscordIPCSync
impl Sync for DiscordIPCSync
impl Unpin for DiscordIPCSync
impl UnsafeUnpin for DiscordIPCSync
impl UnwindSafe for DiscordIPCSync
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more