pub struct IpcClient<Crypto, Com, Ses>where
Crypto: CryptoProvider<Com, Ses>,
Com: CommunicationBackend,
Ses: SessionRepository<Session = Crypto::Session>,{
crypto: Crypto,
communication: Com,
sessions: Ses,
}
Fields§
§crypto: Crypto
§communication: Com
§sessions: Ses
Implementations§
Source§impl<Crypto, Com, Ses> IpcClient<Crypto, Com, Ses>where
Crypto: CryptoProvider<Com, Ses>,
Com: CommunicationBackend,
Ses: SessionRepository<Session = Crypto::Session>,
impl<Crypto, Com, Ses> IpcClient<Crypto, Com, Ses>where
Crypto: CryptoProvider<Com, Ses>,
Com: CommunicationBackend,
Ses: SessionRepository<Session = Crypto::Session>,
pub fn new(crypto: Crypto, communication: Com, sessions: Ses) -> Self
Sourcepub async fn send(
&self,
message: OutgoingMessage,
) -> Result<(), SendError<Crypto::SendError, Com::SendError>>
pub async fn send( &self, message: OutgoingMessage, ) -> Result<(), SendError<Crypto::SendError, Com::SendError>>
Send a message
Sourcepub async fn receive(
&self,
topic: Option<String>,
timeout: Option<Duration>,
) -> Result<IncomingMessage, ReceiveError<Crypto::ReceiveError, Com::ReceiveError>>
pub async fn receive( &self, topic: Option<String>, timeout: Option<Duration>, ) -> Result<IncomingMessage, ReceiveError<Crypto::ReceiveError, Com::ReceiveError>>
Receive a message, optionally filtering by topic.
Setting the topic to None
will receive all messages.
Setting the timeout to None
will wait indefinitely.
Sourcepub async fn receive_typed<Payload>(
&self,
timeout: Option<Duration>,
) -> Result<TypedIncomingMessage<Payload>, TypedReceiveError<<Payload as TryFrom<Vec<u8>>>::Error, Crypto::ReceiveError, Com::ReceiveError>>
pub async fn receive_typed<Payload>( &self, timeout: Option<Duration>, ) -> Result<TypedIncomingMessage<Payload>, TypedReceiveError<<Payload as TryFrom<Vec<u8>>>::Error, Crypto::ReceiveError, Com::ReceiveError>>
Receive a message, skipping any messages that cannot be deserialized into the expected payload type.
Auto Trait Implementations§
impl<Crypto, Com, Ses> Freeze for IpcClient<Crypto, Com, Ses>
impl<Crypto, Com, Ses> RefUnwindSafe for IpcClient<Crypto, Com, Ses>
impl<Crypto, Com, Ses> Send for IpcClient<Crypto, Com, Ses>
impl<Crypto, Com, Ses> Sync for IpcClient<Crypto, Com, Ses>
impl<Crypto, Com, Ses> Unpin for IpcClient<Crypto, Com, Ses>
impl<Crypto, Com, Ses> UnwindSafe for IpcClient<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