Trait TransactionPropagationPolicy

pub trait TransactionPropagationPolicy:
    Send
    + Sync
    + Unpin
    + 'static {
    // Required methods
    fn can_propagate<N>(&self, peer: &mut PeerMetadata<N>) -> bool
       where N: NetworkPrimitives;
    fn on_session_established<N>(&mut self, peer: &mut PeerMetadata<N>)
       where N: NetworkPrimitives;
    fn on_session_closed<N>(&mut self, peer: &mut PeerMetadata<N>)
       where N: NetworkPrimitives;
}
Expand description

A policy defining which peers pending transactions are gossiped to.

Required Methods§

fn can_propagate<N>(&self, peer: &mut PeerMetadata<N>) -> bool

Filter a given peer based on the policy.

This determines whether transactions can be propagated to this peer.

fn on_session_established<N>(&mut self, peer: &mut PeerMetadata<N>)

A callback on the policy when a new peer session is established.

fn on_session_closed<N>(&mut self, peer: &mut PeerMetadata<N>)

A callback on the policy when a peer session is closed.

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§