pub trait StateSynchronizer:
Send
+ Sync
+ 'static {
// Required methods
fn initialize<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = SyncResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn start<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = SyncResult<(JoinHandle<SyncResult<()>>, Receiver<StateSyncMessage<BlockHeader>>)>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn close<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = SyncResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
StateSynchronizer
Used to synchronize the state of a single protocol. The synchronizer is responsible for delivering messages to the client that let him reconstruct subsets of the protocol state.
This involves deciding which components to track according to the clients preferences, retrieving & emitting snapshots of components which the client has not seen yet and subsequently delivering delta messages for the components that have changed.
Required Methods§
fn initialize<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = SyncResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sourcefn start<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = SyncResult<(JoinHandle<SyncResult<()>>, Receiver<StateSyncMessage<BlockHeader>>)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn start<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = SyncResult<(JoinHandle<SyncResult<()>>, Receiver<StateSyncMessage<BlockHeader>>)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Starts the state synchronization.