reth_network_p2p::sync

Trait NetworkSyncUpdater

source
pub trait NetworkSyncUpdater:
    Debug
    + Send
    + Sync
    + 'static {
    // Required methods
    fn update_sync_state(&self, state: SyncState);
    fn update_status(&self, head: Head);
}
Expand description

An updater for updating the SyncState and status of the network.

The node is either syncing, or it is idle. While syncing, the node will download data from the network and process it. The processing consists of several stages, like recovering senders, executing the blocks and indexing. Eventually the node reaches the Finish stage and will transition to SyncState::Idle, it which point the node is considered fully synced.

Required Methods§

source

fn update_sync_state(&self, state: SyncState)

Notifies about a SyncState update.

source

fn update_status(&self, head: Head)

Updates the status of the p2p node

Implementations on Foreign Types§

source§

impl<'a, T: 'a + NetworkSyncUpdater + ?Sized> NetworkSyncUpdater for &'a T
where &'a T: Debug + Send + Sync + 'static,

source§

fn update_sync_state(&self, state: SyncState)

source§

fn update_status(&self, head: Head)

source§

impl<T: NetworkSyncUpdater + ?Sized> NetworkSyncUpdater for Box<T>
where Box<T>: Debug + Send + Sync + 'static,

source§

fn update_sync_state(&self, state: SyncState)

source§

fn update_status(&self, head: Head)

source§

impl<T: NetworkSyncUpdater + ?Sized> NetworkSyncUpdater for Arc<T>
where Arc<T>: Debug + Send + Sync + 'static,

source§

fn update_sync_state(&self, state: SyncState)

source§

fn update_status(&self, head: Head)

Implementors§