pub struct IPCConnection { /* private fields */ }Expand description
A connection between an IPC client and server.
Connections are used to exchange data using Execute, Request, Poke, and Advise operations. The connection can be created by the server (in OnAcceptConnection) or returned from a client’s MakeConnection call.
Implementations§
Source§impl IPCConnection
impl IPCConnection
Sourcepub fn builder() -> IPCConnectionBuilder
pub fn builder() -> IPCConnectionBuilder
Create a new connection builder.
Sourcepub fn execute(&self, data: &[u8], format: IPCFormat) -> bool
pub fn execute(&self, data: &[u8], format: IPCFormat) -> bool
Execute a command on the remote side.
On the server side, this triggers the client’s OnExecute callback. On the client side, this triggers the server’s OnExecute callback.
Sourcepub fn execute_string(&self, data: &str) -> bool
pub fn execute_string(&self, data: &str) -> bool
Execute a string command (convenience method for text data).
Sourcepub fn request(&self, item: &str, format: IPCFormat) -> Option<Vec<u8>>
pub fn request(&self, item: &str, format: IPCFormat) -> Option<Vec<u8>>
Request data from the remote side.
Returns the data if the request was successful, None otherwise.
Sourcepub fn poke(&self, item: &str, data: &[u8], format: IPCFormat) -> bool
pub fn poke(&self, item: &str, data: &[u8], format: IPCFormat) -> bool
Poke data to the remote side.
Sourcepub fn start_advise(&self, item: &str) -> bool
pub fn start_advise(&self, item: &str) -> bool
Start an advise loop for the given item.
The server will send updates via the OnAdvise callback when the item changes.
Sourcepub fn stop_advise(&self, item: &str) -> bool
pub fn stop_advise(&self, item: &str) -> bool
Stop an advise loop for the given item.
Sourcepub fn advise(&self, item: &str, data: &[u8], format: IPCFormat) -> bool
pub fn advise(&self, item: &str, data: &[u8], format: IPCFormat) -> bool
Send advised data to the client (server-side only).
Sourcepub fn disconnect(&self) -> bool
pub fn disconnect(&self) -> bool
Disconnect the connection.
Sourcepub fn is_connected(&self) -> bool
pub fn is_connected(&self) -> bool
Check if the connection is still connected.