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_and_range_hint(
&self,
hashes: Vec<FixedBytes<32>>,
priority: Priority,
range_hint: Option<RangeInclusive<u64>>,
) -> Self::Output;
// Provided methods
fn get_block_bodies(&self, hashes: Vec<FixedBytes<32>>) -> Self::Output { ... }
fn get_block_bodies_with_priority(
&self,
hashes: Vec<FixedBytes<32>>,
priority: Priority,
) -> 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§
Required Methods§
fn get_block_bodies_with_priority_and_range_hint(
&self,
hashes: Vec<FixedBytes<32>>,
priority: Priority,
range_hint: Option<RangeInclusive<u64>>,
) -> Self::Output
fn get_block_bodies_with_priority_and_range_hint( &self, hashes: Vec<FixedBytes<32>>, priority: Priority, range_hint: Option<RangeInclusive<u64>>, ) -> Self::Output
Fetches the block body for the requested block with priority and a range hint for the requested blocks.
The range hint is not required, but can be used to optimize the routing of the request if
the hashes are continuous or close together and the range hint is [earliest, latest]
for
the requested blocks.
Provided Methods§
fn get_block_bodies(&self, hashes: Vec<FixedBytes<32>>) -> Self::Output
fn get_block_bodies(&self, hashes: Vec<FixedBytes<32>>) -> Self::Output
Fetches the block body for the requested block.
fn get_block_bodies_with_priority(
&self,
hashes: Vec<FixedBytes<32>>,
priority: Priority,
) -> Self::Output
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
fn get_block_body(
&self,
hash: FixedBytes<32>,
) -> SingleBodyRequest<Self::Output> ⓘ
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> ⓘ
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
impl BodiesClient for TestBodiesClient
type Body = BlockBody<EthereumTxEnvelope<TxEip4844>>
type Output = Pin<Box<dyn Future<Output = Result<WithPeerId<Vec<BlockBody<EthereumTxEnvelope<TxEip4844>>>>, RequestError>> + Send + Sync>>
fn get_block_bodies_with_priority_and_range_hint( &self, hashes: Vec<FixedBytes<32>>, _priority: Priority, _range_hint: Option<RangeInclusive<u64>>, ) -> <TestBodiesClient as BodiesClient>::Output
§impl<'a, T> BodiesClient for &'a T
impl<'a, T> BodiesClient for &'a T
type Body = <T as BodiesClient>::Body
type Output = <T as BodiesClient>::Output
fn get_block_bodies( &self, hashes: Vec<FixedBytes<32>>, ) -> <&'a T as BodiesClient>::Output
fn get_block_bodies_with_priority( &self, hashes: Vec<FixedBytes<32>>, priority: Priority, ) -> <&'a T as BodiesClient>::Output
fn get_block_bodies_with_priority_and_range_hint( &self, hashes: Vec<FixedBytes<32>>, priority: Priority, range_hint: Option<RangeInclusive<u64>>, ) -> <&'a T as BodiesClient>::Output
fn get_block_body( &self, hash: FixedBytes<32>, ) -> SingleBodyRequest<<&'a T as BodiesClient>::Output> ⓘ
fn get_block_body_with_priority( &self, hash: FixedBytes<32>, priority: Priority, ) -> SingleBodyRequest<<&'a T as BodiesClient>::Output> ⓘ
Source§impl<B> BodiesClient for FileClient<B>where
B: FullBlock,
impl<B> BodiesClient for FileClient<B>where
B: FullBlock,
type Body = <B as Block>::Body
type Output = Pin<Box<dyn Future<Output = Result<WithPeerId<Vec<<B as Block>::Body>>, RequestError>> + Send + Sync>>
fn get_block_bodies_with_priority_and_range_hint( &self, hashes: Vec<FixedBytes<32>>, _priority: Priority, _range_hint: Option<RangeInclusive<u64>>, ) -> <FileClient<B> as BodiesClient>::Output
§impl<T> BodiesClient for Box<T>
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_bodies_with_priority_and_range_hint( &self, hashes: Vec<FixedBytes<32>>, priority: Priority, range_hint: Option<RangeInclusive<u64>>, ) -> <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>
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_bodies_with_priority_and_range_hint( &self, hashes: Vec<FixedBytes<32>>, priority: Priority, range_hint: Option<RangeInclusive<u64>>, ) -> <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 TestFullBlockClient
Implements the BodiesClient
trait for the TestFullBlockClient
struct.
impl BodiesClient for TestFullBlockClient
Implements the BodiesClient
trait for the TestFullBlockClient
struct.
§impl<A, B> BodiesClient for Either<A, B>
impl<A, B> BodiesClient for Either<A, B>
type Body = <A as BodiesClient>::Body
type Output = Either<<A as BodiesClient>::Output, <B as BodiesClient>::Output>
§impl<F> BodiesClient for reth::network::p2p::test_utils::TestBodiesClient<F>where
F: Fn(Vec<FixedBytes<32>>) -> Result<WithPeerId<Vec<BlockBody<EthereumTxEnvelope<TxEip4844>>>>, RequestError> + Send + Sync,
impl<F> BodiesClient for reth::network::p2p::test_utils::TestBodiesClient<F>where
F: Fn(Vec<FixedBytes<32>>) -> Result<WithPeerId<Vec<BlockBody<EthereumTxEnvelope<TxEip4844>>>>, RequestError> + Send + Sync,
Source§impl<N> BodiesClient for FetchClient<N>where
N: NetworkPrimitives,
impl<N> BodiesClient for FetchClient<N>where
N: NetworkPrimitives,
§impl<Net> BodiesClient for NoopFullBlockClient<Net>where
Net: NetworkPrimitives,
Implements the BodiesClient
trait for the NoopFullBlockClient
struct.
impl<Net> BodiesClient for NoopFullBlockClient<Net>where
Net: NetworkPrimitives,
Implements the BodiesClient
trait for the NoopFullBlockClient
struct.