pub struct TestBodiesClient<F> {
pub responder: F,
}Available on crate features
test-utils only.Expand description
A test client for fetching bodies
Fields§
§responder: FThe function that is called on each body request.
Trait Implementations§
Source§impl<F> BodiesClient for TestBodiesClient<F>
impl<F> BodiesClient for TestBodiesClient<F>
Source§type Output = Pin<Box<dyn Future<Output = Result<WithPeerId<Vec<BlockBody<EthereumTxEnvelope<TxEip4844>>>>, RequestError>> + Sync + Send>>
type Output = Pin<Box<dyn Future<Output = Result<WithPeerId<Vec<BlockBody<EthereumTxEnvelope<TxEip4844>>>>, RequestError>> + Sync + Send>>
The output of the request future for querying block bodies.
Source§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_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. Read more
Source§fn 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.
Source§fn 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
Source§fn 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.
Source§fn 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
Source§impl<F> Debug for TestBodiesClient<F>
impl<F> Debug for TestBodiesClient<F>
Source§impl<F: Sync + Send> DownloadClient for TestBodiesClient<F>
impl<F: Sync + Send> DownloadClient for TestBodiesClient<F>
Source§fn report_bad_message(&self, _peer_id: PeerId)
fn report_bad_message(&self, _peer_id: PeerId)
Penalize the peer for responding with a message
that violates validation rules
Source§fn num_connected_peers(&self) -> usize
fn num_connected_peers(&self) -> usize
Returns how many peers the network is currently connected to.
Auto Trait Implementations§
impl<F> Freeze for TestBodiesClient<F>where
F: Freeze,
impl<F> RefUnwindSafe for TestBodiesClient<F>where
F: RefUnwindSafe,
impl<F> Send for TestBodiesClient<F>where
F: Send,
impl<F> Sync for TestBodiesClient<F>where
F: Sync,
impl<F> Unpin for TestBodiesClient<F>where
F: Unpin,
impl<F> UnsafeUnpin for TestBodiesClient<F>where
F: UnsafeUnpin,
impl<F> UnwindSafe for TestBodiesClient<F>where
F: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreimpl<T> MaybeDebug for Twhere
T: Debug,
§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
Layout§
Note: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.