Receiver

Trait Receiver 

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

    // Required method
    fn recv(
        &mut self,
    ) -> impl Future<Output = Result<Message<Self::PublicKey>, Self::Error>> + Send;
}
Expand description

Interface for receiving messages from arbitrary recipients.

Required Associated Types§

Source

type Error: Debug + StdError + Send + Sync

Error that can occur when receiving a message.

Source

type PublicKey: PublicKey

Public key type used to identify recipients.

Required Methods§

Source

fn recv( &mut self, ) -> impl Future<Output = Result<Message<Self::PublicKey>, Self::Error>> + Send

Receive a message from an arbitrary recipient.

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<E: Spawner, R: Receiver> Receiver for SubReceiver<E, R>

Source§

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

Source§

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

Source§

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