Skip to content

Commit

Permalink
chore: Add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
bgins committed Nov 6, 2023
1 parent 1e39d39 commit 809bea6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion homestar-runtime/src/event_handler/notification.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const TYPE_KEY: &str = "type";
const DATA_KEY: &str = "data";
const TIMESTAMP_KEY: &str = "timestamp";

/// Send notification as bytes
/// Send notification as bytes.
pub(crate) fn send(notifier: Notifier, ty: EventNotificationType, data: BTreeMap<&str, String>) {
let notification = EventNotification::new(ty, data);

Expand All @@ -25,6 +25,7 @@ pub(crate) fn send(notifier: Notifier, ty: EventNotificationType, data: BTreeMap
}
}

/// Notification sent to clients.
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub(crate) struct EventNotification {
ty: EventNotificationType,
Expand Down Expand Up @@ -90,6 +91,7 @@ impl TryFrom<Ipld> for EventNotification {
}
}

/// Types of notification sent to clients.
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub(crate) enum EventNotificationType {
SwarmNotification(SwarmNotification),
Expand Down

0 comments on commit 809bea6

Please sign in to comment.