Skip to main content

SnapSyncContext

Trait SnapSyncContext 

Source
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) -> Option<u64> { ... }
}
Expand description

What a SnapBootstrap needs to know about the chain and peers it synchronizes from.

Required Methods§

Source

fn head(&self) -> Result<u64, SnapSyncError>

Highest block whose canonical header is downloaded.

Source

fn wait_for_progress(&mut self, head: u64) -> impl Future<Output = bool> + Send

Waits until the head moves past head or new peers connect, returning false once no further progress will come.

Provided Methods§

Source

fn finalized(&self) -> Option<u64>

Latest finalized block, preferred as the pivot when recent enough.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§