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§
Sourcefn is_block_synced(&self) -> bool
fn is_block_synced(&self) -> bool
Returns true if the node is synced up to the latest block (within the given tolerance).
Sourcefn num_blocks_behind(&self) -> Option<u32>
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.
Sourcefn get_sync_speed(&self) -> f64
fn get_sync_speed(&self) -> f64
Returns the current sync speed in blocks per second.
Provided Methods§
Sourcefn propagate(&self, message: Message<N>, excluded_peers: &[SocketAddr])
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.
Sourcefn propagate_to_validators(
&self,
message: Message<N>,
excluded_peers: &[SocketAddr],
)
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".