pub trait SnapSyncContext: Send {
// Required methods
fn head(&self) -> Result<u64, SnapSyncError>;
fn wait_for_progress(
&mut self,
head: u64,
) -> impl Future<Output = bool> + Send;
// Provided method
fn finalized(&self) -> Result<Option<u64>, SnapSyncError> { ... }
}Expand description
What a SnapBootstrap needs to know about the chain and peers it synchronizes from.
Required Methods§
Sourcefn head(&self) -> Result<u64, SnapSyncError>
fn head(&self) -> Result<u64, SnapSyncError>
Highest block whose canonical header is downloaded.
Sourcefn wait_for_progress(&mut self, head: u64) -> impl Future<Output = bool> + Send
fn wait_for_progress(&mut self, head: u64) -> impl Future<Output = bool> + Send
Waits for a reason to retry the stalled step and returns true if one came, such as new
peers connecting or a retry delay passing. Returns false if the run should stop instead,
so the caller can refresh its headers, as when a new target arrived or the source of
targets is gone.
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".