pub trait BodiesClient: DownloadClient {
type Body: BlockBody;
type Output: Future<Output = PeerRequestResult<Vec<Self::Body>>> + Sync + Send + Unpin;
// Required method
fn get_block_bodies_with_priority_and_range_hint(
&self,
hashes: Vec<B256>,
priority: Priority,
range_hint: Option<RangeInclusive<u64>>,
) -> Self::Output;
// Provided methods
fn get_block_bodies(&self, hashes: Vec<B256>) -> Self::Output { ... }
fn get_block_bodies_with_priority(
&self,
hashes: Vec<B256>,
priority: Priority,
) -> Self::Output { ... }
fn get_block_body(&self, hash: B256) -> SingleBodyRequest<Self::Output> ⓘ { ... }
fn get_block_body_with_priority(
&self,
hash: B256,
priority: Priority,
) -> SingleBodyRequest<Self::Output> ⓘ { ... }
}
Expand description
A client capable of downloading block bodies.
Required Associated Types§
Required Methods§
Sourcefn get_block_bodies_with_priority_and_range_hint(
&self,
hashes: Vec<B256>,
priority: Priority,
range_hint: Option<RangeInclusive<u64>>,
) -> Self::Output
fn get_block_bodies_with_priority_and_range_hint( &self, hashes: Vec<B256>, 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§
Sourcefn get_block_bodies(&self, hashes: Vec<B256>) -> Self::Output
fn get_block_bodies(&self, hashes: Vec<B256>) -> Self::Output
Fetches the block body for the requested block.
Sourcefn get_block_bodies_with_priority(
&self,
hashes: Vec<B256>,
priority: Priority,
) -> Self::Output
fn get_block_bodies_with_priority( &self, hashes: Vec<B256>, priority: Priority, ) -> Self::Output
Fetches the block body for the requested block with priority
Sourcefn get_block_body(&self, hash: B256) -> SingleBodyRequest<Self::Output> ⓘ
fn get_block_body(&self, hash: B256) -> SingleBodyRequest<Self::Output> ⓘ
Fetches a single block body for the requested hash.
Sourcefn get_block_body_with_priority(
&self,
hash: B256,
priority: Priority,
) -> SingleBodyRequest<Self::Output> ⓘ
fn get_block_body_with_priority( &self, hash: B256, priority: Priority, ) -> SingleBodyRequest<Self::Output> ⓘ
Fetches a single block body for the requested hash with priority
Implementations on Foreign Types§
Source§impl<'a, T: 'a + BodiesClient + ?Sized> BodiesClient for &'a Twhere
&'a T: DownloadClient,
impl<'a, T: 'a + BodiesClient + ?Sized> BodiesClient for &'a Twhere
&'a T: DownloadClient,
type Body = <T as BodiesClient>::Body
type Output = <T as BodiesClient>::Output
fn get_block_bodies(&self, hashes: Vec<B256>) -> Self::Output
fn get_block_bodies_with_priority( &self, hashes: Vec<B256>, priority: Priority, ) -> Self::Output
fn get_block_bodies_with_priority_and_range_hint( &self, hashes: Vec<B256>, priority: Priority, range_hint: Option<RangeInclusive<u64>>, ) -> Self::Output
fn get_block_body(&self, hash: B256) -> SingleBodyRequest<Self::Output> ⓘ
fn get_block_body_with_priority( &self, hash: B256, priority: Priority, ) -> SingleBodyRequest<Self::Output> ⓘ
Source§impl<T: BodiesClient + ?Sized> BodiesClient for Box<T>where
Box<T>: DownloadClient,
impl<T: BodiesClient + ?Sized> BodiesClient for Box<T>where
Box<T>: DownloadClient,
type Body = <T as BodiesClient>::Body
type Output = <T as BodiesClient>::Output
fn get_block_bodies(&self, hashes: Vec<B256>) -> Self::Output
fn get_block_bodies_with_priority( &self, hashes: Vec<B256>, priority: Priority, ) -> Self::Output
fn get_block_bodies_with_priority_and_range_hint( &self, hashes: Vec<B256>, priority: Priority, range_hint: Option<RangeInclusive<u64>>, ) -> Self::Output
fn get_block_body(&self, hash: B256) -> SingleBodyRequest<Self::Output> ⓘ
fn get_block_body_with_priority( &self, hash: B256, priority: Priority, ) -> SingleBodyRequest<Self::Output> ⓘ
Source§impl<T: BodiesClient + ?Sized> BodiesClient for Arc<T>where
Arc<T>: DownloadClient,
impl<T: BodiesClient + ?Sized> BodiesClient for Arc<T>where
Arc<T>: DownloadClient,
type Body = <T as BodiesClient>::Body
type Output = <T as BodiesClient>::Output
fn get_block_bodies(&self, hashes: Vec<B256>) -> Self::Output
fn get_block_bodies_with_priority( &self, hashes: Vec<B256>, priority: Priority, ) -> Self::Output
fn get_block_bodies_with_priority_and_range_hint( &self, hashes: Vec<B256>, priority: Priority, range_hint: Option<RangeInclusive<u64>>, ) -> Self::Output
fn get_block_body(&self, hash: B256) -> SingleBodyRequest<Self::Output> ⓘ
fn get_block_body_with_priority( &self, hash: B256, priority: Priority, ) -> SingleBodyRequest<Self::Output> ⓘ
Implementors§
Source§impl BodiesClient for TestFullBlockClient
Available on crate features test-utils
only.Implements the BodiesClient
trait for the TestFullBlockClient
struct.
impl BodiesClient for TestFullBlockClient
Available on crate features
test-utils
only.Implements the BodiesClient
trait for the TestFullBlockClient
struct.
Source§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>
Source§impl<F> BodiesClient for TestBodiesClient<F>
Available on crate features test-utils
only.
impl<F> BodiesClient for TestBodiesClient<F>
Available on crate features
test-utils
only.Source§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.