Sender

Trait Sender 

Source
pub trait Sender:
    Clone
    + Debug
    + Send
    + 'static {
    type Error: Debug + StdError + Send + Sync;
    type PublicKey: PublicKey;

    // Required method
    fn send(
        &mut self,
        recipients: Recipients<Self::PublicKey>,
        message: Bytes,
        priority: bool,
    ) -> impl Future<Output = Result<Vec<Self::PublicKey>, Self::Error>> + Send;
}
Expand description

Interface for sending messages to a set of recipients.

Required Associated Types§

Source

type Error: Debug + StdError + Send + Sync

Error that can occur when sending a message.

Source

type PublicKey: PublicKey

Public key type used to identify recipients.

Required Methods§

Source

fn send( &mut self, recipients: Recipients<Self::PublicKey>, message: Bytes, priority: bool, ) -> impl Future<Output = Result<Vec<Self::PublicKey>, Self::Error>> + Send

Send a message to a set of recipients.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<P: PublicKey> Sender for commonware_p2p::authenticated::discovery::Sender<P>

Source§

impl<P: PublicKey> Sender for commonware_p2p::authenticated::lookup::Sender<P>

Source§

impl<P: PublicKey> Sender for commonware_p2p::simulated::Sender<P>

Source§

impl<S: Sender> Sender for SubSender<S>