Blocker

Trait Blocker 

Source
pub trait Blocker:
    Clone
    + Send
    + 'static {
    type PublicKey: PublicKey;

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

Interface for blocking other peers.

Required Associated Types§

Source

type PublicKey: PublicKey

Public key type used to identify peers.

Required Methods§

Source

fn block(&mut self, peer: Self::PublicKey) -> impl Future<Output = ()> + Send

Block a peer, disconnecting them if currently connected and preventing future connections.

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 + Metrics, C: PublicKey> Blocker for commonware_p2p::authenticated::discovery::Oracle<E, C>

Source§

impl<E: Spawner + Metrics, C: PublicKey> Blocker for commonware_p2p::authenticated::lookup::Oracle<E, C>