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(
&self,
hashes: Vec<B256>,
priority: Priority,
) -> Self::Output;
// Provided methods
fn get_block_bodies(&self, hashes: Vec<B256>) -> 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(
&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
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_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_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_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_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 NoopFullBlockClient
Available on crate feature test-utils
only.Implements the BodiesClient
trait for the NoopFullBlockClient
struct.
impl BodiesClient for NoopFullBlockClient
Available on crate feature
test-utils
only.Implements the BodiesClient
trait for the NoopFullBlockClient
struct.
Source§impl BodiesClient for TestFullBlockClient
Available on crate feature test-utils
only.Implements the BodiesClient
trait for the TestFullBlockClient
struct.
impl BodiesClient for TestFullBlockClient
Available on crate feature
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 feature test-utils
only.
impl<F> BodiesClient for TestBodiesClient<F>
Available on crate feature
test-utils
only.