pub trait TaskP2PService: Send {
// Required methods
fn get_all_peer_info(&self) -> Vec<(&PeerId, &PeerInfo)>;
fn get_peer_id_with_height(&self, height: &BlockHeight) -> Option<PeerId>;
fn next_event(&mut self) -> BoxFuture<'_, Option<FuelP2PEvent>>;
fn publish_message(
&mut self,
message: GossipsubBroadcastRequest,
) -> Result<()>;
fn send_request_msg(
&mut self,
peer_id: Option<PeerId>,
request_msg: RequestMessage,
on_response: ResponseSender,
) -> Result<()>;
fn send_response_msg(
&mut self,
request_id: InboundRequestId,
message: ResponseMessage,
) -> Result<()>;
fn report_message(
&mut self,
message: GossipsubMessageInfo,
acceptance: GossipsubMessageAcceptance,
) -> Result<()>;
fn report_peer(
&mut self,
peer_id: PeerId,
score: AppScore,
reporting_service: &str,
) -> Result<()>;
fn update_block_height(&mut self, height: BlockHeight) -> Result<()>;
fn update_metrics<T>(&self, update_fn: T)
where T: FnOnce();
}
Required Methods§
fn get_all_peer_info(&self) -> Vec<(&PeerId, &PeerInfo)>
fn get_peer_id_with_height(&self, height: &BlockHeight) -> Option<PeerId>
fn next_event(&mut self) -> BoxFuture<'_, Option<FuelP2PEvent>>
fn publish_message(&mut self, message: GossipsubBroadcastRequest) -> Result<()>
fn send_request_msg( &mut self, peer_id: Option<PeerId>, request_msg: RequestMessage, on_response: ResponseSender, ) -> Result<()>
fn send_response_msg( &mut self, request_id: InboundRequestId, message: ResponseMessage, ) -> Result<()>
fn report_message( &mut self, message: GossipsubMessageInfo, acceptance: GossipsubMessageAcceptance, ) -> Result<()>
fn report_peer( &mut self, peer_id: PeerId, score: AppScore, reporting_service: &str, ) -> Result<()>
fn update_block_height(&mut self, height: BlockHeight) -> Result<()>
fn update_metrics<T>(&self, update_fn: T)where
T: FnOnce(),
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.