Trait discord_rich_presence::DiscordIpc [−][src]
pub trait DiscordIpc { fn get_valid_path(&mut self) -> Result<Option<PathBuf>, Box<dyn Error>>; fn close(&mut self) -> Result<(), Box<dyn Error>>; fn connect(&mut self, client_id: &str) -> Result<(), Box<dyn Error>> { ... } fn send_handshake(&mut self, client_id: &str) -> Result<(), Box<dyn Error>> { ... } fn send(&mut self, data: Value, opcode: u8) -> Result<(), Box<dyn Error>> { ... } fn recv(&mut self) -> Result<(u32, Value), Box<dyn Error>> { ... } fn set_activity(
&mut self,
activity_payload: Value
) -> Result<(), Box<dyn Error>> { ... } }
Expand description
A client that connects to and communicates with the Discord IPC.
Required methods
Provided methods
fn connect(&mut self, client_id: &str) -> Result<(), Box<dyn Error>>
[src]
fn connect(&mut self, client_id: &str) -> Result<(), Box<dyn Error>>
[src]Connects the client to the Discord IPC. This method is typically called automatically by the new_client function.
fn send_handshake(&mut self, client_id: &str) -> Result<(), Box<dyn Error>>
[src]
fn send_handshake(&mut self, client_id: &str) -> Result<(), Box<dyn Error>>
[src]Handshakes the Discord IPC. Usually called automatically by connect
fn send(&mut self, data: Value, opcode: u8) -> Result<(), Box<dyn Error>>
[src]
fn send(&mut self, data: Value, opcode: u8) -> Result<(), Box<dyn Error>>
[src]Sends JSON data to the Discord IPC.