pub trait ServiceNetworkSender: Send {
    fn send(
        &self,
        recipient: &str,
        message: &[u8]
    ) -> Result<(), ServiceSendError>; fn send_and_await(
        &self,
        recipient: &str,
        message: &[u8]
    ) -> Result<Vec<u8>, ServiceSendError>; fn reply(
        &self,
        message_origin: &ServiceMessageContext,
        message: &[u8]
    ) -> Result<(), ServiceSendError>; fn clone_box(&self) -> Box<dyn ServiceNetworkSender>; fn send_with_sender(
        &mut self,
        recipient: &str,
        message: &[u8],
        sender: &str
    ) -> Result<(), ServiceSendError>; }
Expand description

The ServiceNetworkSender trait allows a service to send its own messages, such as replies to the original message or forwarding the message to other services on the same circuit. It does not expose the circuit information directly.

Required Methods

Send the message bytes to the given recipient (another service)

Send the message bytes to the given recipient (another service) and await the reply. This function blocks until the reply is returned.

Send the message bytes back to the origin specified in the given message context.

Clone this instance into Boxed, dynamic trait

Send the message bytes to the given recipient (another service) with a configurable message sender

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Implementors