Trait request_response::network::Sender

source ·
pub trait Sender<K: SignatureKey + 'static>:
    Send
    + Sync
    + 'static
    + Clone {
    // Required method
    fn send_message<'life0, 'life1, 'async_trait>(
        &'life0 self,
        message: &'life1 Bytes,
        recipient: K,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

The Sender trait is used to allow the [RequestResponseProtocol] to send messages to a specific recipient

Required Methods§

source

fn send_message<'life0, 'life1, 'async_trait>( &'life0 self, message: &'life1 Bytes, recipient: K, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Send a message to the specified recipient

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<T, K> Sender<K> for T
where T: Deref<Target: ConnectedNetwork<K>> + Send + Sync + 'static + Clone, K: SignatureKey + 'static,

A blanket implementation of the Sender trait for all types that dereference to ConnectedNetwork