From 0992071a7f1a36424bcfaf1fbc84541ea041df1a Mon Sep 17 00:00:00 2001 From: hozan23 Date: Thu, 11 Apr 2024 10:19:20 +0200 Subject: add support for tokio & improve net crate api --- p2p/Cargo.toml | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) (limited to 'p2p/Cargo.toml') diff --git a/p2p/Cargo.toml b/p2p/Cargo.toml index fc14de2..3327810 100644 --- a/p2p/Cargo.toml +++ b/p2p/Cargo.toml @@ -1,42 +1,43 @@ [package] name = "karyon_p2p" -version.workspace = true +version.workspace = true edition.workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +[features] +default = ["smol"] +smol = ["karyon_core/smol", "karyon_net/smol", "dep:futures-rustls"] +tokio = ["karyon_core/tokio", "karyon_net/tokio", "dep:tokio-rustls"] + [dependencies] -karyon_core = { workspace = true, features=["crypto"] } -karyon_net.workspace = true +karyon_core = { workspace = true, features = [ + "crypto", +], default-features = false } +karyon_net = { workspace = true, default-features = false } -smol = "2.0.0" async-trait = "0.1.77" -futures-util = {version = "0.3.5", features=["std"], default-features = false } +async-channel = "2.3.0" +futures-util = { version = "0.3.5", features = [ + "std", +], default-features = false } log = "0.4.21" chrono = "0.4.35" -bincode = { version="2.0.0-rc.3", features = ["derive"]} +bincode = { version = "2.0.0-rc.3", features = ["derive"] } rand = "0.8.5" thiserror = "1.0.58" semver = "1.0.22" sha2 = "0.10.8" # tls -futures-rustls = { version = "0.25.1", features = ["aws-lc-rs"] } rcgen = "0.12.1" yasna = "0.5.2" x509-parser = "0.16.0" - -[[example]] -name = "peer" -path = "examples/peer.rs" - -[[example]] -name = "chat" -path = "examples/chat.rs" - -[[example]] -name = "monitor" -path = "examples/monitor.rs" +futures-rustls = { version = "0.25.1", features = [ + "aws-lc-rs", +], optional = true } +tokio-rustls = { version = "0.26.0", features = ["aws-lc-rs"], optional = true } +rustls-pki-types = "1.7.0" [dev-dependencies] async-std = "1.12.0" @@ -44,3 +45,4 @@ clap = { version = "4.5.2", features = ["derive"] } ctrlc = "3.4.4" easy-parallel = "3.3.1" env_logger = "0.11.3" +smol = "2.0.0" -- cgit v1.2.3