Skip to content

Commit

Permalink
Merge pull request #153 from Berrysoft/fix/features
Browse files Browse the repository at this point in the history
feat: add some features for monocrate
  • Loading branch information
George-Miao authored Nov 24, 2023
2 parents a35a814 + 57dc968 commit 71eb738
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 17 deletions.
9 changes: 1 addition & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ compio-net = { path = "./compio-net", version = "0.2.0-beta.1" }
compio-signal = { path = "./compio-signal", version = "0.1.1-beta.1" }
compio-dispatcher = { path = "./compio-dispatcher", version = "0.1.0-beta.1" }
compio-log = { path = "./compio-log", version = "0.1.0-beta.1" }
compio-tls = { path = "./compio-tls", version = "0.1.0-beta.1" }
compio-tls = { path = "./compio-tls", version = "0.1.0-beta.1", default-features = false }

cfg-if = "1.0.0"
criterion = "0.5.1"
Expand All @@ -46,16 +46,9 @@ nix = "0.27.1"
once_cell = "1.18.0"
os_pipe = "1.1.4"
paste = "1.0.14"
send_wrapper = "0.6"
slab = "0.4.9"
socket2 = "0.5.5"
tempfile = "3.8.1"
tokio = "1.33.0"
widestring = "1.0.2"
windows-sys = "0.48.0"

native-tls = "0.2.11"
rustls = "0.22.0-alpha.4"
rustls-native-certs = "0.7.0-alpha.1"

hyper = "0.14"
8 changes: 4 additions & 4 deletions compio-tls/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "compio-tls"
version = "0.1.0-beta.1"
version = "0.1.0-beta.2"
description = "TLS adaptor with compio"
categories = ["asynchronous", "network-programming"]
keywords = ["async", "net", "tls"]
Expand All @@ -18,15 +18,15 @@ rustdoc-args = ["--cfg", "docsrs"]
compio-buf = { workspace = true }
compio-io = { workspace = true, features = ["compat"] }

native-tls = { workspace = true, optional = true }
rustls = { workspace = true, optional = true }
native-tls = { version = "0.2.11", optional = true }
rustls = { version = "0.22.0-alpha.4", optional = true }

[dev-dependencies]
compio-net = { workspace = true }
compio-runtime = { workspace = true }
compio-macros = { workspace = true }

rustls-native-certs = { workspace = true }
rustls-native-certs = "0.7.0-alpha.1"

[features]
default = ["native-tls"]
Expand Down
5 changes: 5 additions & 0 deletions compio-tls/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
#![cfg_attr(feature = "read_buf", feature(read_buf, core_io_borrowed_buf))]
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]

#[cfg(feature = "native-tls")]
pub use native_tls;
#[cfg(feature = "rustls")]
pub use rustls;

mod adapter;
mod stream;

Expand Down
21 changes: 16 additions & 5 deletions compio/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "compio"
version = "0.9.0-beta.2"
version = "0.9.0-beta.3"
description = "completion based async runtime"
categories = ["asynchronous", "filesystem", "network-programming"]
keywords = ["async", "fs", "iocp", "io-uring", "net"]
Expand Down Expand Up @@ -39,7 +39,7 @@ compio-io = { workspace = true, optional = true }
compio-net = { workspace = true }
compio-signal = { workspace = true, optional = true }
compio-dispatcher = { workspace = true, optional = true }
compio-log = { workspace = true, optional = true }
compio-log = { workspace = true }
compio-tls = { workspace = true, optional = true }

# Shared dev dependencies for all platforms
Expand Down Expand Up @@ -74,6 +74,7 @@ default = ["runtime", "io-uring"]
io-uring = ["compio-driver/io-uring"]
polling = ["compio-driver/polling"]
io = ["dep:compio-io"]
io-compat = ["io", "compio-io/compat"]
runtime = [
"dep:compio-runtime",
"compio-fs/runtime",
Expand All @@ -86,10 +87,17 @@ signal = ["dep:compio-signal", "event"]
time = ["compio-runtime/time", "runtime"]
dispatcher = ["dep:compio-dispatcher", "runtime"]
tls = ["dep:compio-tls"]
all = ["time", "macros", "signal", "dispatcher", "tls"]
native-tls = ["tls", "compio-tls/native-tls"]
rustls = ["tls", "compio-tls/rustls"]
all = ["time", "macros", "signal", "dispatcher", "native-tls", "rustls"]

arrayvec = ["compio-buf/arrayvec"]
bumpalo = ["compio-buf/bumpalo"]
bytes = ["compio-buf/bytes"]
criterion = ["compio-runtime?/criterion"]

enable_log = ["compio-log/enable_log"]

# Nightly features
allocator_api = ["compio-buf/allocator_api", "compio-io?/allocator_api"]
lazy_cell = ["compio-signal?/lazy_cell"]
Expand All @@ -98,9 +106,12 @@ once_cell_try = [
"compio-runtime?/once_cell_try",
"compio-signal?/once_cell_try",
]
read_buf = ["compio-buf/read_buf", "compio-io?/read_buf"]
read_buf = [
"compio-buf/read_buf",
"compio-io?/read_buf",
"compio-tls?/read_buf",
]
try_trait_v2 = ["compio-buf/try_trait_v2"]
enable_log = ["compio-log/enable_log"]
nightly = [
"allocator_api",
"lazy_cell",
Expand Down
10 changes: 10 additions & 0 deletions compio/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
#![warn(missing_docs)]

#[cfg(feature = "arrayvec")]
pub use buf::arrayvec;
#[cfg(feature = "bumpalo")]
pub use buf::bumpalo;
#[cfg(feature = "bytes")]
pub use buf::bytes;
#[doc(no_inline)]
pub use buf::BufResult;
#[cfg(feature = "dispatcher")]
Expand All @@ -47,5 +53,9 @@ pub use runtime::event;
#[cfg(feature = "time")]
#[doc(no_inline)]
pub use runtime::time;
#[cfg(feature = "native-tls")]
pub use tls::native_tls;
#[cfg(feature = "rustls")]
pub use tls::rustls;
#[doc(inline)]
pub use {compio_buf as buf, compio_driver as driver, compio_fs as fs, compio_net as net};

0 comments on commit 71eb738

Please sign in to comment.