1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#[allow(unused_imports)]
use super::*;

use crate::SwarmBuilder;

pub struct ProviderPhase {}

impl SwarmBuilder<NoProviderSpecified, ProviderPhase> {
    #[cfg(all(not(target_arch = "wasm32"), feature = "async-std"))]
    pub fn with_async_std(self) -> SwarmBuilder<AsyncStd, TcpPhase> {
        SwarmBuilder {
            keypair: self.keypair,
            phantom: std::marker::PhantomData,
            phase: TcpPhase {},
        }
    }

    #[cfg(all(not(target_arch = "wasm32"), feature = "tokio"))]
    pub fn with_tokio(self) -> SwarmBuilder<Tokio, TcpPhase> {
        SwarmBuilder {
            keypair: self.keypair,
            phantom: std::marker::PhantomData,
            phase: TcpPhase {},
        }
    }

    #[cfg(feature = "wasm-bindgen")]
    pub fn with_wasm_bindgen(self) -> SwarmBuilder<WasmBindgen, TcpPhase> {
        SwarmBuilder {
            keypair: self.keypair,
            phantom: std::marker::PhantomData,
            phase: TcpPhase {},
        }
    }
}

pub enum NoProviderSpecified {}

#[cfg(all(not(target_arch = "wasm32"), feature = "async-std"))]
pub enum AsyncStd {}

#[cfg(all(not(target_arch = "wasm32"), feature = "tokio"))]
pub enum Tokio {}

#[cfg(feature = "wasm-bindgen")]
pub enum WasmBindgen {}