Now this should build

Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
This commit is contained in:
slinkydeveloper 2021-07-06 15:58:44 +02:00 committed by Francesco Guardiani
parent fe8a9ffc98
commit 4cee94c660
9 changed files with 25 additions and 28 deletions

View File

@ -97,7 +97,7 @@ jobs:
with:
command: build
toolchain: ${{ matrix.toolchain }}
args: --target wasm32-unknown-unknown --features reqwest-binding
args: --target wasm32-unknown-unknown --features reqwest
# Build examples
- uses: actions-rs/cargo@v1

View File

@ -17,10 +17,10 @@ categories = ["web-programming", "encoding", "data-structures"]
name = "cloudevents"
[features]
actix-binding = ["actix-web", "async-trait", "lazy_static", "bytes", "futures"]
reqwest-binding = ["reqwest", "async-trait", "lazy_static", "bytes"]
rdkafka-binding = ["rdkafka", "lazy_static", "bytes"]
warp-binding = ["warp", "lazy_static", "bytes", "http", "hyper"]
actix = ["actix-web", "async-trait", "lazy_static", "bytes", "futures"]
reqwest = ["reqwest-lib", "async-trait", "lazy_static", "bytes"]
rdkafka = ["rdkafka-lib", "lazy_static", "bytes"]
warp = ["warp-lib", "lazy_static", "bytes", "http", "hyper"]
[dependencies]
serde = { version = "^1.0", features = ["derive"] }
@ -34,9 +34,9 @@ bitflags = "^1.2"
# runtime optional deps
actix-web = { version = "^3", default-features = false, optional = true }
reqwest = { version = "^0.11", default-features = false, features = ["rustls-tls"], optional = true }
rdkafka = { version = "^0.25", features = ["cmake-build"], optional = true }
warp = { version = "^0.3", optional = true }
reqwest-lib = { version = "^0.11", default-features = false, features = ["rustls-tls"], optional = true, package = "reqwest" }
rdkafka-lib = { version = "^0.25", features = ["cmake-build"], optional = true, package = "rdkafka" }
warp-lib = { version = "^0.3", optional = true, package = "warp" }
async-trait = { version = "^0.1.33", optional = true }
lazy_static = { version = "1.4.0", optional = true }
bytes = { version = "^1.0", optional = true }

View File

@ -25,10 +25,10 @@ The core modules include definitions for the `Event` and
mechanism to support various Protocol Bindings, each of which is
enabled by a specific [feature flag]:
* `actix-binding`: Integration with [actix](https://actix.rs/).
* `warp-binding`: Integration with [warp](https://github.com/seanmonstar/warp/).
* `reqwest-binding`: Integration with [reqwest](https://github.com/seanmonstar/reqwest).
* `rdkafka-binding`: Integration with [rdkafka](https://fede1024.github.io/rust-rdkafka).
* `actix`: Integration with [actix](https://actix.rs/).
* `warp`: Integration with [warp](https://github.com/seanmonstar/warp/).
* `reqwest`: Integration with [reqwest](https://github.com/seanmonstar/reqwest).
* `rdkafka`: Integration with [rdkafka](https://fede1024.github.io/rust-rdkafka).
This crate is continuously tested to work with GNU libc, WASM and musl
toolchains.
@ -40,7 +40,7 @@ enabling your Protocol Binding of choice:
```toml
[dependencies]
cloudevents-sdk = { version = "0.3.1", features = ["actix-binding"] }
cloudevents-sdk = { version = "0.3.1", features = ["actix"] }
```
Now you can start creating events:

View File

@ -5,12 +5,9 @@ authors = ["Francesco Guardiani <francescoguard@gmail.com>"]
edition = "2018"
[dependencies]
cloudevents-sdk = { path = "../..", features = ["actix-binding"] }
cloudevents-sdk = { path = "../..", features = ["actix"] }
actix-web = "^3"
actix-cors = "^0.5"
lazy_static = "1.4.0"
bytes = "^0.5"
futures = "^0.3"
serde_json = "^1.0"
url = { version = "^2.1" }
env_logger = "0.7.1"

View File

@ -8,7 +8,7 @@ edition = "2018"
[dependencies]
async-trait = "^0.1.33"
cloudevents-sdk = { path = "../..", features = ["rdkafka-binding"] }
cloudevents-sdk = { path = "../..", features = ["rdkafka"] }
lazy_static = "1.4.0"
bytes = "^1.0"
url = { version = "^2.1", features = ["serde"] }

View File

@ -11,7 +11,7 @@ crate-type = ["cdylib"]
[dependencies]
reqwest = "^0.11"
cloudevents-sdk = { path = "../..", features = ["reqwest-binding"] }
cloudevents-sdk = { path = "../..", features = ["reqwest"] }
url = { version = "^2.1" }
web-sys = { version = "0.3.39", features = ["Window", "Location"] }
wasm-bindgen-futures = "0.4.12"

View File

@ -7,6 +7,6 @@ categories = ["web-programming", "encoding"]
license-file = "../LICENSE"
[dependencies]
cloudevents-sdk = { path = "../..", features = ["warp-binding"] }
cloudevents-sdk = { path = "../..", features = ["warp"] }
warp = "^0.3"
tokio = { version = "^1.0", features = ["full"] }

View File

@ -1,10 +1,10 @@
//! Provides protocol binding implementations for [`Event`].
#[cfg(feature = "actix-binding")]
#[cfg(feature = "actix")]
pub mod actix;
#[cfg(feature = "rdkafka-binding")]
#[cfg(feature = "rdkafka")]
pub mod rdkafka;
#[cfg(feature = "reqwest-binding")]
#[cfg(feature = "reqwest")]
pub mod reqwest;
#[cfg(feature = "warp-binding")]
#[cfg(feature = "warp")]
pub mod warp;

View File

@ -36,7 +36,7 @@
//! Cloudevents uses a set of [feature flags] to conditionally compile
//! only the module associated with the Protocol Binding you need:
//!
//! - `actix-binding`: Enables the [actix] protocol binding module. This
//! - `actix`: Enables the [actix] protocol binding module. This
//! extends the [`actix_web::HttpRequest`] with a
//! [`to_event`](actix::HttpRequestExt::to_event) function, the
//! [`actix_web::dev::HttpResponseBuilder`] with an
@ -44,9 +44,9 @@
//! and implementations for [`actix_web::FromRequest`] and
//! [`actix_web::Responder`] in order to take advantage of actix-web's
//! [Extractors] and [Responders]
//! - `reqwest-binding`: Enables the [reqwest] protocol binding module.
//! - `warp-binding`: Enables the [warp] protocol binding module.
//! - `rdkafka-binding`: Enables the [rdkafka] protocol binding module to
//! - `reqwest`: Enables the [reqwest] protocol binding module.
//! - `warp`: Enables the [warp] protocol binding module.
//! - `rdkafka`: Enables the [rdkafka] protocol binding module to
//! seamlessly consume/produce cloudevents within Kafka messages.
//!
//! [feature flags]: https://doc.rust-lang.org/cargo/reference/manifest.html#the-features-section