bevy_event_bus 1.2.0

A Bevy plugin that connects Bevy's event system to external message brokers like Kafka
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
//! Serializable payload types exchanged via the event bus.

use bevy::prelude::Message;
use serde::{Serialize, de::DeserializeOwned};

/// Marker trait for types that can be sent and received via the event bus.
///
/// Any type that implements `Serialize`, `DeserializeOwned`, `Clone`, `Message`, and `Sync`
/// automatically implements `BusMessage`. Registration is handled by the topology builder
/// when configuring a backend.
pub trait BusMessage: Serialize + DeserializeOwned + Message + Sync + Clone + 'static {}

impl<T> BusMessage for T where T: Serialize + DeserializeOwned + Message + Sync + Clone + 'static {}