Skip to main content

SnapClient

Trait SnapClient 

Source
pub trait SnapClient: DownloadClient {
    type Output: Future<Output = Result<WithPeerId<SnapResponse>, RequestError>> + Send + Sync + Unpin;

    // Required methods
    fn get_account_range_with_priority(
        &self,
        request: GetAccountRangeMessage,
        priority: Priority,
    ) -> Self::Output;
    fn get_storage_ranges(
        &self,
        request: GetStorageRangesMessage,
    ) -> Self::Output;
    fn get_storage_ranges_with_priority(
        &self,
        request: GetStorageRangesMessage,
        priority: Priority,
    ) -> Self::Output;
    fn get_byte_codes(&self, request: GetByteCodesMessage) -> Self::Output;
    fn get_byte_codes_with_priority(
        &self,
        request: GetByteCodesMessage,
        priority: Priority,
    ) -> Self::Output;
    fn get_block_access_lists_with_priority(
        &self,
        request: GetBlockAccessListsMessage,
        priority: Priority,
    ) -> Self::Output;

    // Provided methods
    fn get_account_range(&self, request: GetAccountRangeMessage) -> Self::Output { ... }
    fn get_block_access_lists(
        &self,
        request: GetBlockAccessListsMessage,
    ) -> Self::Output { ... }
}
Expand description

The snap sync downloader client

Required Associated Types§

Source

type Output: Future<Output = Result<WithPeerId<SnapResponse>, RequestError>> + Send + Sync + Unpin

The output future type for snap requests

Required Methods§

Source

fn get_account_range_with_priority( &self, request: GetAccountRangeMessage, priority: Priority, ) -> Self::Output

Sends the account range request to the p2p network with priority set and returns the account range response received from a peer.

Source

fn get_storage_ranges(&self, request: GetStorageRangesMessage) -> Self::Output

Sends the storage ranges request to the p2p network and returns the storage ranges response received from a peer.

Source

fn get_storage_ranges_with_priority( &self, request: GetStorageRangesMessage, priority: Priority, ) -> Self::Output

Sends the storage ranges request to the p2p network with priority set and returns the storage ranges response received from a peer.

Source

fn get_byte_codes(&self, request: GetByteCodesMessage) -> Self::Output

Sends the byte codes request to the p2p network and returns the byte codes response received from a peer.

Source

fn get_byte_codes_with_priority( &self, request: GetByteCodesMessage, priority: Priority, ) -> Self::Output

Sends the byte codes request to the p2p network with priority set and returns the byte codes response received from a peer.

Source

fn get_block_access_lists_with_priority( &self, request: GetBlockAccessListsMessage, priority: Priority, ) -> Self::Output

Sends the block access lists request to the p2p network with priority set and returns the block access lists response received from a peer.

Only valid for snap/2 (EIP-8189).

Provided Methods§

Source

fn get_account_range(&self, request: GetAccountRangeMessage) -> Self::Output

Sends the account range request to the p2p network and returns the account range response received from a peer.

Source

fn get_block_access_lists( &self, request: GetBlockAccessListsMessage, ) -> Self::Output

Sends the block access lists request to the p2p network and returns the block access lists response received from a peer.

Only valid for snap/2 (EIP-8189).

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<'a, T> SnapClient for &'a T
where T: 'a + SnapClient + ?Sized, &'a T: DownloadClient,

Source§

impl<T> SnapClient for Arc<T>

Source§

impl<T> SnapClient for Box<T>

Implementors§