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§