p2p/
p2p_service.rs

1pub use redux::TimeService;
2
3pub use crate::{
4    channels::P2pChannelsService, connection::P2pConnectionService,
5    disconnection_effectful::P2pDisconnectionService,
6};
7
8#[cfg(all(not(target_arch = "wasm32"), feature = "p2p-libp2p"))]
9pub use crate::{P2pCryptoService, P2pMioService, P2pNetworkService};
10
11#[cfg(all(not(target_arch = "wasm32"), feature = "p2p-libp2p"))]
12pub trait P2pService:
13    TimeService
14    + P2pConnectionService
15    + P2pDisconnectionService
16    + P2pChannelsService
17    + P2pMioService
18    + P2pCryptoService
19    + P2pNetworkService
20{
21}
22
23#[cfg(all(not(target_arch = "wasm32"), feature = "p2p-libp2p"))]
24impl<T> P2pService for T where
25    T: TimeService
26        + P2pConnectionService
27        + P2pDisconnectionService
28        + P2pChannelsService
29        + P2pMioService
30        + P2pCryptoService
31        + P2pNetworkService
32{
33}
34
35#[cfg(not(all(not(target_arch = "wasm32"), feature = "p2p-libp2p")))]
36pub trait P2pService:
37    TimeService + P2pConnectionService + P2pDisconnectionService + P2pChannelsService
38{
39}
40
41#[cfg(not(all(not(target_arch = "wasm32"), feature = "p2p-libp2p")))]
42impl<T> P2pService for T where
43    T: TimeService + P2pConnectionService + P2pDisconnectionService + P2pChannelsService
44{
45}