pub struct IpcClientImpl<Crypto, Com, Ses>where
Crypto: CryptoProvider<Com, Ses>,
Com: CommunicationBackend,
Ses: SessionRepository<Crypto::Session>,{
inner: Arc<IpcClientInner<Crypto, Com, Ses>>,
}Expand description
An IPC client that handles communication between different components and clients. It uses a crypto provider to encrypt and decrypt messages, a communication backend to send and receive messages, and a session repository to persist sessions.
This is the concrete implementation of the IpcClient trait.
Fields§
§inner: Arc<IpcClientInner<Crypto, Com, Ses>>Implementations§
Source§impl<Crypto, Com, Ses> IpcClientImpl<Crypto, Com, Ses>where
Crypto: CryptoProvider<Com, Ses>,
Com: CommunicationBackend,
Ses: SessionRepository<Crypto::Session>,
impl<Crypto, Com, Ses> IpcClientImpl<Crypto, Com, Ses>where
Crypto: CryptoProvider<Com, Ses>,
Com: CommunicationBackend,
Ses: SessionRepository<Crypto::Session>,
Trait Implementations§
Source§impl<Crypto, Com, Ses> Clone for IpcClientImpl<Crypto, Com, Ses>where
Crypto: CryptoProvider<Com, Ses>,
Com: CommunicationBackend,
Ses: SessionRepository<Crypto::Session>,
impl<Crypto, Com, Ses> Clone for IpcClientImpl<Crypto, Com, Ses>where
Crypto: CryptoProvider<Com, Ses>,
Com: CommunicationBackend,
Ses: SessionRepository<Crypto::Session>,
Source§impl<Crypto, Com, Ses> IpcClient for IpcClientImpl<Crypto, Com, Ses>where
Crypto: CryptoProvider<Com, Ses>,
Com: CommunicationBackend,
Ses: SessionRepository<Crypto::Session>,
impl<Crypto, Com, Ses> IpcClient for IpcClientImpl<Crypto, Com, Ses>where
Crypto: CryptoProvider<Com, Ses>,
Com: CommunicationBackend,
Ses: SessionRepository<Crypto::Session>,
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,
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
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,
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,
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.Auto Trait Implementations§
impl<Crypto, Com, Ses> Freeze for IpcClientImpl<Crypto, Com, Ses>
impl<Crypto, Com, Ses> !RefUnwindSafe for IpcClientImpl<Crypto, Com, Ses>
impl<Crypto, Com, Ses> Send for IpcClientImpl<Crypto, Com, Ses>
impl<Crypto, Com, Ses> Sync for IpcClientImpl<Crypto, Com, Ses>
impl<Crypto, Com, Ses> Unpin for IpcClientImpl<Crypto, Com, Ses>
impl<Crypto, Com, Ses> UnsafeUnpin for IpcClientImpl<Crypto, Com, Ses>
impl<Crypto, Com, Ses> !UnwindSafe for IpcClientImpl<Crypto, Com, Ses>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IpcClientExt for T
impl<T> IpcClientExt for T
Source§fn register_rpc_handler<H>(&self, handler: H) -> impl Future<Output = ()> + Send
fn register_rpc_handler<H>(&self, handler: H) -> impl Future<Output = ()> + Send
Register a new RPC handler for processing incoming RPC requests.
The handler will be executed by the IPC client when an RPC request is received and
the response will be sent back over IPC.
Source§fn send_typed<Payload>(
&self,
payload: Payload,
destination: Endpoint,
) -> impl Future<Output = Result<(), RequestError>> + Send
fn send_typed<Payload>( &self, payload: Payload, destination: Endpoint, ) -> impl Future<Output = Result<(), RequestError>> + Send
Send a message with a payload of any serializable type to the specified destination.
Source§fn subscribe_typed<Payload>(
&self,
) -> impl Future<Output = Result<IpcClientTypedSubscription<Payload>, SubscribeError>> + Sendwhere
Payload: DeserializeOwned + PayloadTypeName,
fn subscribe_typed<Payload>(
&self,
) -> impl Future<Output = Result<IpcClientTypedSubscription<Payload>, SubscribeError>> + Sendwhere
Payload: DeserializeOwned + PayloadTypeName,
Create a subscription to receive messages that can be deserialized into the provided
payload type.
Source§fn request<Request>(
&self,
request: Request,
destination: Endpoint,
cancellation_token: Option<CancellationToken>,
) -> impl Future<Output = Result<Request::Response, RequestError>> + Send
fn request<Request>( &self, request: Request, destination: Endpoint, cancellation_token: Option<CancellationToken>, ) -> impl Future<Output = Result<Request::Response, RequestError>> + Send
Send a request to the specified destination and wait for a response.
The destination must have a registered RPC handler for the request type, otherwise
an error will be returned by the remote endpoint.