|
1 | 1 | use rivet_envoy_protocol as protocol; |
2 | 2 | #[cfg(any( |
3 | | - feature = "native-transport", |
4 | | - all(feature = "wasm-transport", target_arch = "wasm32") |
| 3 | + rivet_envoy_native_transport, |
| 4 | + all(rivet_envoy_wasm_transport, target_arch = "wasm32") |
5 | 5 | ))] |
6 | 6 | use rivet_util_serde::HashableMap; |
7 | 7 | use vbare::OwnedVersionedData; |
8 | 8 |
|
9 | 9 | use crate::context::SharedContext; |
10 | 10 | use crate::context::WsTxMessage; |
11 | 11 | #[cfg(any( |
12 | | - feature = "native-transport", |
13 | | - all(feature = "wasm-transport", target_arch = "wasm32") |
| 12 | + rivet_envoy_native_transport, |
| 13 | + all(rivet_envoy_wasm_transport, target_arch = "wasm32") |
14 | 14 | ))] |
15 | 15 | use crate::envoy::ToEnvoyMessage; |
16 | 16 | #[cfg(any( |
17 | | - feature = "native-transport", |
18 | | - all(feature = "wasm-transport", target_arch = "wasm32") |
| 17 | + rivet_envoy_native_transport, |
| 18 | + all(rivet_envoy_wasm_transport, target_arch = "wasm32") |
19 | 19 | ))] |
20 | 20 | use crate::stringify::stringify_to_envoy; |
21 | 21 | use crate::stringify::stringify_to_rivet; |
22 | 22 |
|
23 | | -#[cfg(all(feature = "native-transport", feature = "wasm-transport"))] |
24 | | -compile_error!( |
25 | | - "`native-transport` and `wasm-transport` are mutually exclusive. Enable exactly one envoy-client transport." |
26 | | -); |
27 | | - |
28 | | -#[cfg(not(any(feature = "native-transport", feature = "wasm-transport")))] |
29 | | -compile_error!( |
30 | | - "rivet-envoy-client requires a WebSocket transport. Enable `native-transport` or `wasm-transport`." |
31 | | -); |
32 | | - |
33 | | -#[cfg(feature = "native-transport")] |
| 23 | +#[cfg(rivet_envoy_native_transport)] |
34 | 24 | mod native; |
35 | | -#[cfg(feature = "wasm-transport")] |
| 25 | +mod transport; |
| 26 | +#[cfg(rivet_envoy_wasm_transport)] |
36 | 27 | mod wasm; |
37 | 28 |
|
38 | | -#[cfg(feature = "native-transport")] |
39 | | -pub use native::start_connection; |
40 | | -#[cfg(feature = "wasm-transport")] |
41 | | -pub use wasm::start_connection; |
| 29 | +pub use transport::start_connection; |
42 | 30 |
|
43 | 31 | #[cfg(any( |
44 | | - feature = "native-transport", |
45 | | - all(feature = "wasm-transport", target_arch = "wasm32") |
| 32 | + rivet_envoy_native_transport, |
| 33 | + all(rivet_envoy_wasm_transport, target_arch = "wasm32") |
46 | 34 | ))] |
47 | 35 | async fn send_initial_metadata(shared: &SharedContext) { |
48 | 36 | let mut prepopulate_map = HashableMap::new(); |
@@ -73,8 +61,8 @@ async fn send_initial_metadata(shared: &SharedContext) { |
73 | 61 | } |
74 | 62 |
|
75 | 63 | #[cfg(any( |
76 | | - feature = "native-transport", |
77 | | - all(feature = "wasm-transport", target_arch = "wasm32") |
| 64 | + rivet_envoy_native_transport, |
| 65 | + all(rivet_envoy_wasm_transport, target_arch = "wasm32") |
78 | 66 | ))] |
79 | 67 | async fn forward_to_envoy(shared: &SharedContext, message: protocol::ToEnvoy) { |
80 | 68 | if tracing::enabled!(tracing::Level::DEBUG) { |
|
0 commit comments