pub struct DiscordIPC { /* private fields */ }Expand description
Basic Discord rich presence IPC implementation. See the docs: https://docs.rs/crate/filthy-rich/latest
Implementations§
Source§impl DiscordIPC
impl DiscordIPC
Sourcepub fn new_from(client_id: &str) -> Result<Self>
pub fn new_from(client_id: &str) -> Result<Self>
Given a client ID, create a new DiscordIPC instance. Needs to have Discord running for successful execution.
Examples found in repository?
More examples
Sourcepub fn handshake(&mut self) -> Result<()>
pub fn handshake(&mut self) -> Result<()>
Bare-bones implementation of handshake with the Discord IPC.
Use .run() instead.
Sourcepub fn wait_for_ready(&mut self) -> Result<()>
pub fn wait_for_ready(&mut self) -> Result<()>
Look out for READY in socket frames. Use .run() instead.
Sourcepub fn run(&mut self) -> Result<()>
pub fn run(&mut self) -> Result<()>
Convenience function for performing handshake, waiting for READY opcode and handling the IPC response loop.
Examples found in repository?
More examples
Sourcepub fn wait(&mut self) -> Result<()>
pub fn wait(&mut self) -> Result<()>
Waits for response from IPC task; can be used to run the client indefinitely.
Sourcepub fn set_activity(&mut self, details: &str, state: &str) -> Result<()>
pub fn set_activity(&mut self, details: &str, state: &str) -> Result<()>
Sets a tiny Discord rich presence activity.
Examples found in repository?
More examples
Auto Trait Implementations§
impl Freeze for DiscordIPC
impl !RefUnwindSafe for DiscordIPC
impl Send for DiscordIPC
impl Sync for DiscordIPC
impl Unpin for DiscordIPC
impl !UnwindSafe for DiscordIPC
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