[−][src]Trait splinter::service::ServiceNetworkSender
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
fn send(&self, recipient: &str, message: &[u8]) -> Result<(), ServiceSendError>
Send the message bytes to the given recipient (another service)
fn send_and_await(
&self,
recipient: &str,
message: &[u8]
) -> Result<Vec<u8>, ServiceSendError>
&self,
recipient: &str,
message: &[u8]
) -> Result<Vec<u8>, ServiceSendError>
Send the message bytes to the given recipient (another service) and await the reply. This function blocks until the reply is returned.
fn reply(
&self,
message_origin: &ServiceMessageContext,
message: &[u8]
) -> Result<(), ServiceSendError>
&self,
message_origin: &ServiceMessageContext,
message: &[u8]
) -> Result<(), ServiceSendError>
Send the message bytes back to the origin specified in the given message context.
fn clone_box(&self) -> Box<dyn ServiceNetworkSender>
Clone this instance into Boxed, dynamic trait