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> ⓘ { ... }
}
Available on crate feature
network
only.Expand description
A client capable of downloading block bodies.
Required Associated Types§
Required Methods§
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
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_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<TransactionSigned>
type Output = Pin<Box<dyn Future<Output = Result<WithPeerId<Vec<BlockBody<TransactionSigned>>>, RequestError>> + Send + Sync>>
fn get_block_bodies_with_priority( &self, hashes: Vec<FixedBytes<32>>, _priority: Priority, ) -> <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_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( &self, hashes: Vec<FixedBytes<32>>, _priority: Priority, ) -> <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_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_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.
impl BodiesClient for NoopFullBlockClient
Implements the BodiesClient
trait for the NoopFullBlockClient
struct.
§impl BodiesClient for TestFullBlockClient
Implements the BodiesClient
trait for the TestFullBlockClient
struct.
impl BodiesClient for TestFullBlockClient
Implements the BodiesClient
trait for the TestFullBlockClient
struct.