Trait BodiesClient

pub trait BodiesClient: DownloadClient {
    type Body: BlockBody;
    type Output: Future<Output = Result<WithPeerId<Vec<Self::Body>>, RequestError>> + Sync + Send + Unpin;

    // Required method
    fn get_block_bodies_with_priority(
        &self,
        hashes: Vec<FixedBytes<32>>,
        priority: Priority,
    ) -> Self::Output;

    // Provided methods
    fn get_block_bodies(&self, hashes: Vec<FixedBytes<32>>) -> Self::Output { ... }
    fn get_block_body(
        &self,
        hash: FixedBytes<32>,
    ) -> SingleBodyRequest<Self::Output>  { ... }
    fn get_block_body_with_priority(
        &self,
        hash: FixedBytes<32>,
        priority: Priority,
    ) -> SingleBodyRequest<Self::Output>  { ... }
}
Expand description

A client capable of downloading block bodies.

Required Associated Types§

type Body: BlockBody

The body type this client fetches.

type Output: Future<Output = Result<WithPeerId<Vec<Self::Body>>, RequestError>> + Sync + Send + Unpin

The output of the request future for querying block bodies.

Required Methods§

fn get_block_bodies_with_priority( &self, hashes: Vec<FixedBytes<32>>, priority: Priority, ) -> Self::Output

Fetches the block body for the requested block with priority

Provided Methods§

fn get_block_bodies(&self, hashes: Vec<FixedBytes<32>>) -> Self::Output

Fetches the block body for the requested block.

fn get_block_body( &self, hash: FixedBytes<32>, ) -> SingleBodyRequest<Self::Output>

Fetches a single block body for the requested hash.

fn get_block_body_with_priority( &self, hash: FixedBytes<32>, priority: Priority, ) -> SingleBodyRequest<Self::Output>

Fetches a single block body for the requested hash with priority

Implementations on Foreign Types§

Source§

impl BodiesClient for TestBodiesClient

Source§

type Body = BlockBody<TransactionSigned>

Source§

type Output = Pin<Box<dyn Future<Output = Result<WithPeerId<Vec<BlockBody<TransactionSigned>>>, RequestError>> + Send + Sync>>

Source§

fn get_block_bodies_with_priority( &self, hashes: Vec<FixedBytes<32>>, _priority: Priority, ) -> <TestBodiesClient as BodiesClient>::Output

§

impl<'a, T> BodiesClient for &'a T

Source§

impl<B> BodiesClient for FileClient<B>
where B: FullBlock,

Source§

type Body = <B as Block>::Body

Source§

type Output = Pin<Box<dyn Future<Output = Result<WithPeerId<Vec<<B as Block>::Body>>, RequestError>> + Send + Sync>>

Source§

fn get_block_bodies_with_priority( &self, hashes: Vec<FixedBytes<32>>, _priority: Priority, ) -> <FileClient<B> as BodiesClient>::Output

§

impl<T> BodiesClient for Box<T>

§

type Body = <T as BodiesClient>::Body

§

type Output = <T as BodiesClient>::Output

§

fn get_block_bodies( &self, hashes: Vec<FixedBytes<32>>, ) -> <Box<T> as BodiesClient>::Output

§

fn get_block_bodies_with_priority( &self, hashes: Vec<FixedBytes<32>>, priority: Priority, ) -> <Box<T> as BodiesClient>::Output

§

fn get_block_body( &self, hash: FixedBytes<32>, ) -> SingleBodyRequest<<Box<T> as BodiesClient>::Output>

§

fn get_block_body_with_priority( &self, hash: FixedBytes<32>, priority: Priority, ) -> SingleBodyRequest<<Box<T> as BodiesClient>::Output>

§

impl<T> BodiesClient for Arc<T>

§

type Body = <T as BodiesClient>::Body

§

type Output = <T as BodiesClient>::Output

§

fn get_block_bodies( &self, hashes: Vec<FixedBytes<32>>, ) -> <Arc<T> as BodiesClient>::Output

§

fn get_block_bodies_with_priority( &self, hashes: Vec<FixedBytes<32>>, priority: Priority, ) -> <Arc<T> as BodiesClient>::Output

§

fn get_block_body( &self, hash: FixedBytes<32>, ) -> SingleBodyRequest<<Arc<T> as BodiesClient>::Output>

§

fn get_block_body_with_priority( &self, hash: FixedBytes<32>, priority: Priority, ) -> SingleBodyRequest<<Arc<T> as BodiesClient>::Output>

Implementors§

§

impl BodiesClient for NoopFullBlockClient

Implements the BodiesClient trait for the NoopFullBlockClient struct.

§

type Body = BlockBody<TransactionSigned>

§

type Output = Ready<Result<WithPeerId<Vec<BlockBody<TransactionSigned>>>, RequestError>>

§

impl BodiesClient for TestFullBlockClient

Implements the BodiesClient trait for the TestFullBlockClient struct.

§

type Body = BlockBody<TransactionSigned>

§

type Output = Ready<Result<WithPeerId<Vec<BlockBody<TransactionSigned>>>, RequestError>>

§

impl<A, B> BodiesClient for Either<A, B>
where A: BodiesClient, B: BodiesClient<Body = <A as BodiesClient>::Body>,

§

impl<F> BodiesClient for reth::network::p2p::test_utils::TestBodiesClient<F>
where F: Fn(Vec<FixedBytes<32>>) -> Result<WithPeerId<Vec<BlockBody<TransactionSigned>>>, RequestError> + Send + Sync,

§

type Body = BlockBody<TransactionSigned>

§

type Output = Pin<Box<dyn Future<Output = Result<WithPeerId<Vec<BlockBody<TransactionSigned>>>, RequestError>> + Send + Sync>>

Source§

impl<N> BodiesClient for FetchClient<N>