Skip to content

Commit 4cee94c

Browse files
Now this should build
Signed-off-by: Francesco Guardiani <[email protected]>
1 parent fe8a9ff commit 4cee94c

File tree

9 files changed

+25
-28
lines changed

9 files changed

+25
-28
lines changed

.github/workflows/rust_tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ jobs:
9797
with:
9898
command: build
9999
toolchain: ${{ matrix.toolchain }}
100-
args: --target wasm32-unknown-unknown --features reqwest-binding
100+
args: --target wasm32-unknown-unknown --features reqwest
101101

102102
# Build examples
103103
- uses: actions-rs/cargo@v1

Cargo.toml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ categories = ["web-programming", "encoding", "data-structures"]
1717
name = "cloudevents"
1818

1919
[features]
20-
actix-binding = ["actix-web", "async-trait", "lazy_static", "bytes", "futures"]
21-
reqwest-binding = ["reqwest", "async-trait", "lazy_static", "bytes"]
22-
rdkafka-binding = ["rdkafka", "lazy_static", "bytes"]
23-
warp-binding = ["warp", "lazy_static", "bytes", "http", "hyper"]
20+
actix = ["actix-web", "async-trait", "lazy_static", "bytes", "futures"]
21+
reqwest = ["reqwest-lib", "async-trait", "lazy_static", "bytes"]
22+
rdkafka = ["rdkafka-lib", "lazy_static", "bytes"]
23+
warp = ["warp-lib", "lazy_static", "bytes", "http", "hyper"]
2424

2525
[dependencies]
2626
serde = { version = "^1.0", features = ["derive"] }
@@ -34,9 +34,9 @@ bitflags = "^1.2"
3434

3535
# runtime optional deps
3636
actix-web = { version = "^3", default-features = false, optional = true }
37-
reqwest = { version = "^0.11", default-features = false, features = ["rustls-tls"], optional = true }
38-
rdkafka = { version = "^0.25", features = ["cmake-build"], optional = true }
39-
warp = { version = "^0.3", optional = true }
37+
reqwest-lib = { version = "^0.11", default-features = false, features = ["rustls-tls"], optional = true, package = "reqwest" }
38+
rdkafka-lib = { version = "^0.25", features = ["cmake-build"], optional = true, package = "rdkafka" }
39+
warp-lib = { version = "^0.3", optional = true, package = "warp" }
4040
async-trait = { version = "^0.1.33", optional = true }
4141
lazy_static = { version = "1.4.0", optional = true }
4242
bytes = { version = "^1.0", optional = true }

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ The core modules include definitions for the `Event` and
2525
mechanism to support various Protocol Bindings, each of which is
2626
enabled by a specific [feature flag]:
2727

28-
* `actix-binding`: Integration with [actix](https://actix.rs/).
29-
* `warp-binding`: Integration with [warp](https://github.com/seanmonstar/warp/).
30-
* `reqwest-binding`: Integration with [reqwest](https://github.com/seanmonstar/reqwest).
31-
* `rdkafka-binding`: Integration with [rdkafka](https://fede1024.github.io/rust-rdkafka).
28+
* `actix`: Integration with [actix](https://actix.rs/).
29+
* `warp`: Integration with [warp](https://github.com/seanmonstar/warp/).
30+
* `reqwest`: Integration with [reqwest](https://github.com/seanmonstar/reqwest).
31+
* `rdkafka`: Integration with [rdkafka](https://fede1024.github.io/rust-rdkafka).
3232

3333
This crate is continuously tested to work with GNU libc, WASM and musl
3434
toolchains.
@@ -40,7 +40,7 @@ enabling your Protocol Binding of choice:
4040

4141
```toml
4242
[dependencies]
43-
cloudevents-sdk = { version = "0.3.1", features = ["actix-binding"] }
43+
cloudevents-sdk = { version = "0.3.1", features = ["actix"] }
4444
```
4545

4646
Now you can start creating events:

example-projects/actix-web-example/Cargo.toml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,9 @@ authors = ["Francesco Guardiani <[email protected]>"]
55
edition = "2018"
66

77
[dependencies]
8-
cloudevents-sdk = { path = "../..", features = ["actix-binding"] }
8+
cloudevents-sdk = { path = "../..", features = ["actix"] }
99
actix-web = "^3"
1010
actix-cors = "^0.5"
11-
lazy_static = "1.4.0"
12-
bytes = "^0.5"
13-
futures = "^0.3"
1411
serde_json = "^1.0"
1512
url = { version = "^2.1" }
1613
env_logger = "0.7.1"

example-projects/rdkafka-example/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ edition = "2018"
88

99
[dependencies]
1010
async-trait = "^0.1.33"
11-
cloudevents-sdk = { path = "../..", features = ["rdkafka-binding"] }
11+
cloudevents-sdk = { path = "../..", features = ["rdkafka"] }
1212
lazy_static = "1.4.0"
1313
bytes = "^1.0"
1414
url = { version = "^2.1", features = ["serde"] }

example-projects/reqwest-wasm-example/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ crate-type = ["cdylib"]
1111

1212
[dependencies]
1313
reqwest = "^0.11"
14-
cloudevents-sdk = { path = "../..", features = ["reqwest-binding"] }
14+
cloudevents-sdk = { path = "../..", features = ["reqwest"] }
1515
url = { version = "^2.1" }
1616
web-sys = { version = "0.3.39", features = ["Window", "Location"] }
1717
wasm-bindgen-futures = "0.4.12"

example-projects/warp-example/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ categories = ["web-programming", "encoding"]
77
license-file = "../LICENSE"
88

99
[dependencies]
10-
cloudevents-sdk = { path = "../..", features = ["warp-binding"] }
10+
cloudevents-sdk = { path = "../..", features = ["warp"] }
1111
warp = "^0.3"
1212
tokio = { version = "^1.0", features = ["full"] }

src/binding/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
//! Provides protocol binding implementations for [`Event`].
22
3-
#[cfg(feature = "actix-binding")]
3+
#[cfg(feature = "actix")]
44
pub mod actix;
5-
#[cfg(feature = "rdkafka-binding")]
5+
#[cfg(feature = "rdkafka")]
66
pub mod rdkafka;
7-
#[cfg(feature = "reqwest-binding")]
7+
#[cfg(feature = "reqwest")]
88
pub mod reqwest;
9-
#[cfg(feature = "warp-binding")]
9+
#[cfg(feature = "warp")]
1010
pub mod warp;

src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,17 @@
3636
//! Cloudevents uses a set of [feature flags] to conditionally compile
3737
//! only the module associated with the Protocol Binding you need:
3838
//!
39-
//! - `actix-binding`: Enables the [actix] protocol binding module. This
39+
//! - `actix`: Enables the [actix] protocol binding module. This
4040
//! extends the [`actix_web::HttpRequest`] with a
4141
//! [`to_event`](actix::HttpRequestExt::to_event) function, the
4242
//! [`actix_web::dev::HttpResponseBuilder`] with an
4343
//! [`event`](actix::HttpResponseBuilderExt::event) function,
4444
//! and implementations for [`actix_web::FromRequest`] and
4545
//! [`actix_web::Responder`] in order to take advantage of actix-web's
4646
//! [Extractors] and [Responders]
47-
//! - `reqwest-binding`: Enables the [reqwest] protocol binding module.
48-
//! - `warp-binding`: Enables the [warp] protocol binding module.
49-
//! - `rdkafka-binding`: Enables the [rdkafka] protocol binding module to
47+
//! - `reqwest`: Enables the [reqwest] protocol binding module.
48+
//! - `warp`: Enables the [warp] protocol binding module.
49+
//! - `rdkafka`: Enables the [rdkafka] protocol binding module to
5050
//! seamlessly consume/produce cloudevents within Kafka messages.
5151
//!
5252
//! [feature flags]: https://doc.rust-lang.org/cargo/reference/manifest.html#the-features-section

0 commit comments

Comments
 (0)