Skip to content

Commit b9cca38

Browse files
committed
fix(cloudevents): fix builds for cloudevents features in docs
Signed-off-by: Raphael Höser <[email protected]>
1 parent 2849f1c commit b9cca38

File tree

5 files changed

+10
-2
lines changed

5 files changed

+10
-2
lines changed

src/event.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ pub use event_types::management_event::ManagementEvent;
1111
pub use trace_info::TraceInfo;
1212

1313
#[cfg(feature = "cloudevents")]
14-
use crate::error::EventError;
14+
pub use crate::error::EventError;

src/event/event_types/event.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ use serde::{Deserialize, Serialize};
33
use serde_json::Value;
44

55
use crate::event::{EventCandidate, trace_info::TraceInfo};
6+
#[cfg(feature = "cloudevents")]
7+
use cloudevents::EventBuilder;
68

79
/// Represents an event that has been received from the DB.
810
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]

src/event/event_types/event_candidate.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@ use typed_builder::TypedBuilder;
55

66
#[cfg(feature = "cloudevents")]
77
use crate::error::EventError;
8+
#[cfg(feature = "cloudevents")]
9+
use cloudevents::AttributesReader;
810

911
/// Represents an event candidate that can be sent to the DB.
10-
/// This is a simplified version of the [`super::Event`] type.
12+
/// This is a simplified version of the [`super::event::Event`] type.
1113
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, TypedBuilder)]
1214
pub struct EventCandidate {
1315
/// The data of the event, serialized as JSON

src/event/event_types/management_event.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
use chrono::{DateTime, Utc};
22
use serde::{Deserialize, Serialize};
33
use serde_json::Value;
4+
#[cfg(feature = "cloudevents")]
5+
use cloudevents::EventBuilder;
46

57
/// Represents a management event that has been received from the DB.
68
///

src/event/trace_info.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
//! This module holds supporting traits for the "Tracing" feature of eventsourcingdb.
22
33
use serde::{Deserialize, Serialize};
4+
#[cfg(feature = "cloudevents")]
5+
use crate::error::EventError;
46

57
/// Represents the trace information of an event.
68
/// This is used for distributed tracing.

0 commit comments

Comments
 (0)