Skip to content

Commit ceb034b

Browse files
committed
Document feature flags
Signed-off-by: Jim Crossley <[email protected]>
1 parent dc81cf6 commit ceb034b

File tree

3 files changed

+27
-3
lines changed

3 files changed

+27
-3
lines changed

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ cargo test --all-features --all
3939
To build and open the documentation:
4040

4141
```sh
42-
cargo doc --lib --open
42+
cargo doc --all-features --lib --open
4343
```
4444

4545
Before performing the PR, once you have committed all changes, run:

src/event/types.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,6 @@ impl TryIntoTime for String {
5555
/// here.
5656
///
5757
/// Also see:
58-
/// * https://github.com/cloudevents/spec/blob/v1.0.1/spec.md#type-system
59-
/// * https://tools.ietf.org/html/rfc3986#section-4.1
58+
/// * <https://github.com/cloudevents/spec/blob/v1.0.1/spec.md#type-system>
59+
/// * <https://tools.ietf.org/html/rfc3986#section-4.1>
6060
pub type UriReference = String;

src/lib.rs

+24
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,30 @@
3131
//! * Traits and utilities in [`message`] to implement Protocol Bindings
3232
//! * Feature-guarded modules for various Protocol Binding implementations, e.g. actix, reqwest, warp, rdkafka
3333
//!
34+
//! ## Feature flags
35+
//!
36+
//! Cloudevents uses a set of [feature flags] to conditionally compile
37+
//! only the module associated with the Protocol Binding you need:
38+
//!
39+
//! - `cloudevents-actix`: Enables the [actix] module. This
40+
//! extends the [`actix_web::HttpRequest`] with a
41+
//! [`to_event`](actix::HttpRequestExt::to_event) function, the
42+
//! [`actix_web::dev::HttpResponseBuilder`] with an
43+
//! [`event`](actix::HttpResponseBuilderExt::event) function,
44+
//! and implementations for [`actix_web::FromRequest`] and
45+
//! [`actix_web::Responder`] in order to take advantage of actix-web's
46+
//! [Extractors] and [Responders]
47+
//!
48+
//! - `cloudevents-reqwest`: Enables the [reqwest] module.
49+
//!
50+
//! - `cloudevents-warp`: Enables the [warp] module.
51+
//!
52+
//! - `cloudevents-rdkafka`: Enables the [rdkafka] module to
53+
//! seamlessly consume/produce cloudevents within Kafka messages.
54+
//!
55+
//! [feature flags]: https://doc.rust-lang.org/cargo/reference/manifest.html#the-features-section
56+
//! [Extractors]: https://actix.rs/docs/extractors/
57+
//! [Responders]: https://actix.rs/docs/handlers/
3458
3559
#![deny(broken_intra_doc_links)]
3660

0 commit comments

Comments
 (0)