pub(crate) struct BlockSyncClientStub {
responses: Receiver<(VerifyingKey, BlockSyncResponse)>,
}
Expand description
A receiving end for sync responses. The BlockSyncClientStub::recv_response
method returns
the received response.
Fields§
§responses: Receiver<(VerifyingKey, BlockSyncResponse)>
Implementations§
source§impl BlockSyncClientStub
impl BlockSyncClientStub
pub(crate) fn new( responses: Receiver<(VerifyingKey, BlockSyncResponse)>, ) -> BlockSyncClientStub
sourcepub(crate) fn recv_response(
&self,
peer: VerifyingKey,
deadline: Instant,
) -> Result<BlockSyncResponse, BlockSyncResponseReceiveError>
pub(crate) fn recv_response( &self, peer: VerifyingKey, deadline: Instant, ) -> Result<BlockSyncResponse, BlockSyncResponseReceiveError>
Receive a BlockSyncResponse from a given peer. Waits for the response until the deadline is reached, and if no response is received it returns BlockSyncResponseReceiveError::Timeout.
Auto Trait Implementations§
impl Freeze for BlockSyncClientStub
impl RefUnwindSafe for BlockSyncClientStub
impl Send for BlockSyncClientStub
impl !Sync for BlockSyncClientStub
impl Unpin for BlockSyncClientStub
impl UnwindSafe for BlockSyncClientStub
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