Skip to main content

Outbound

Trait Outbound 

Source
pub trait Outbound<N: Network> {
    // Required methods
    fn router(&self) -> &Router<N>;
    fn is_block_synced(&self) -> bool;
    fn num_blocks_behind(&self) -> Option<u32>;
    fn get_sync_speed(&self) -> f64;

    // Provided methods
    fn propagate(&self, message: Message<N>, excluded_peers: &[SocketAddr]) { ... }
    fn propagate_to_validators(
        &self,
        message: Message<N>,
        excluded_peers: &[SocketAddr],
    ) { ... }
}

Required Methods§

Source

fn router(&self) -> &Router<N>

Returns a reference to the router.

Source

fn is_block_synced(&self) -> bool

Returns true if the node is synced up to the latest block (within the given tolerance).

Source

fn num_blocks_behind(&self) -> Option<u32>

Returns the number of blocks this node is behind the greatest peer height, or None if not connected to peers yet.

Source

fn get_sync_speed(&self) -> f64

Returns the current sync speed in blocks per second.

Provided Methods§

Source

fn propagate(&self, message: Message<N>, excluded_peers: &[SocketAddr])

Sends the given message to every connected peer, excluding the sender and any specified peer IPs.

Source

fn propagate_to_validators( &self, message: Message<N>, excluded_peers: &[SocketAddr], )

Sends the given message to every connected validator, excluding the sender and any specified IPs.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§