Skip to content

Commit 169162c

Browse files
committed
feat: feature-gate quic support
1 parent 6cd700a commit 169162c

File tree

4 files changed

+17
-4
lines changed

4 files changed

+17
-4
lines changed

msg-socket/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ parking_lot.workspace = true
2828

2929
[dev-dependencies]
3030
rand.workspace = true
31+
msg-transport = { workspace = true, features = ["quic"] }
3132

3233
msg-sim.workspace = true
3334

msg-transport/Cargo.toml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,17 @@ async-trait.workspace = true
1717
futures.workspace = true
1818
tokio.workspace = true
1919
tracing.workspace = true
20-
thiserror.workspace = true
2120

22-
quinn.workspace = true
23-
rustls.workspace = true
24-
rcgen.workspace = true
21+
thiserror = { workspace = true, optional = true }
22+
23+
# QUIC
24+
quinn = { workspace = true, optional = true }
25+
rustls = { workspace = true, optional = true }
26+
rcgen = { workspace = true, optional = true }
2527

2628
[dev-dependencies]
2729
tracing-subscriber = "0.3"
30+
31+
[features]
32+
default = []
33+
quic = ["dep:quinn", "dep:rustls", "dep:rcgen", "dep:thiserror"]

msg-transport/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ use futures::{Future, FutureExt};
1818
use tokio::io::{AsyncRead, AsyncWrite};
1919

2020
pub mod ipc;
21+
#[cfg(feature = "quic")]
2122
pub mod quic;
2223
pub mod tcp;
2324

msg/Cargo.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ rand.workspace = true
2828
criterion.workspace = true
2929
pprof.workspace = true
3030

31+
[features]
32+
default = []
33+
quic = ["msg-transport/quic"]
34+
35+
3136
# Add jemalloc for extra perf on Linux systems.
3237
[target.'cfg(all(not(windows), not(target_env = "musl")))'.dependencies]
3338
jemallocator = { version = "0.5.0", features = ["profiling"] }

0 commit comments

Comments
 (0)