hopr_transport_probe/
traits.rs1use async_trait::async_trait;
2use hopr_network_types::types::DestinationRouting;
3use libp2p_identity::PeerId;
4
5#[cfg_attr(test, mockall::automock)]
6#[async_trait]
7pub trait PeerDiscoveryFetch {
8 async fn get_peers(&self, from_timestamp: std::time::SystemTime) -> Vec<PeerId>;
10}
11
12#[async_trait]
13pub trait ProbeStatusUpdate {
14 async fn on_finished(&self, peer: &PeerId, result: &crate::errors::Result<std::time::Duration>);
16}
17
18pub trait TrafficGeneration {
28 fn build(
29 self,
30 ) -> (
31 impl futures::Stream<Item = DestinationRouting> + Send,
32 impl futures::Sink<crate::errors::Result<crate::types::Telemetry>, Error = impl std::error::Error>
33 + Send
34 + Sync
35 + Clone
36 + 'static,
37 );
38}
39
40const _: () = assert!(size_of::<u128>() > crate::content::PathTelemetry::ID_SIZE);