reth::network

Trait NetworkSyncUpdater

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§

fn update_sync_state(&self, state: SyncState)

Notifies about a SyncState update.

fn update_status(&self, head: Head)

Updates the status of the p2p node

Implementations on Foreign Types§

§

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

§

fn update_sync_state(&self, state: SyncState)

§

fn update_status(&self, head: Head)

§

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

§

fn update_sync_state(&self, state: SyncState)

§

fn update_status(&self, head: Head)

§

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

§

fn update_sync_state(&self, state: SyncState)

§

fn update_status(&self, head: Head)

Implementors§

§

impl NetworkSyncUpdater for NetworkHandle

§

impl NetworkSyncUpdater for NoopSyncStateUpdater