Skip to main content

IpcClient

Trait IpcClient 

Source
pub trait IpcClient: Send + Sync {
    // Required methods
    fn start<'life0, 'async_trait>(
        &'life0 self,
        cancellation_token: Option<CancellationToken>,
    ) -> Pin<Box<dyn Future<Output = Result<(), AlreadyRunningError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn is_running(&self) -> bool;
    fn send<'life0, 'async_trait>(
        &'life0 self,
        message: OutgoingMessage,
    ) -> Pin<Box<dyn Future<Output = Result<(), SendError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn subscribe<'life0, 'async_trait>(
        &'life0 self,
        topic: Option<String>,
    ) -> Pin<Box<dyn Future<Output = Result<IpcClientSubscription, SubscribeError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Dyn-compatible trait for IPC client operations.

This trait provides the core IPC operations that consumers can use without being tied to a specific concrete IpcClient implementation. For generic convenience methods (typed subscriptions, RPC requests), use the IpcClientExt extension trait which is automatically implemented for all IpcClient implementors.

Required Methods§

Source

fn start<'life0, 'async_trait>( &'life0 self, cancellation_token: Option<CancellationToken>, ) -> Pin<Box<dyn Future<Output = Result<(), AlreadyRunningError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Start the IPC client, which will begin listening for incoming messages and processing them.

Source

fn is_running(&self) -> bool

Check if the IPC client task is currently running.

Source

fn send<'life0, 'async_trait>( &'life0 self, message: OutgoingMessage, ) -> Pin<Box<dyn Future<Output = Result<(), SendError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Send a message over IPC.

Source

fn subscribe<'life0, 'async_trait>( &'life0 self, topic: Option<String>, ) -> Pin<Box<dyn Future<Output = Result<IpcClientSubscription, SubscribeError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Subscribe to receive messages, optionally filtered by topic. Setting the topic to None will receive all messages.

Implementors§

Source§

impl<Crypto, Com, Ses> IpcClient for IpcClientImpl<Crypto, Com, Ses>
where Crypto: CryptoProvider<Com, Ses>, Com: CommunicationBackend, Ses: SessionRepository<Crypto::Session>,