summaryrefslogtreecommitdiffstats
path: root/crates/core/tedge_lib/src/notification.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/core/tedge_lib/src/notification.rs')
-rw-r--r--crates/core/tedge_lib/src/notification.rs24
1 files changed, 24 insertions, 0 deletions
diff --git a/crates/core/tedge_lib/src/notification.rs b/crates/core/tedge_lib/src/notification.rs
new file mode 100644
index 00000000..776a4365
--- /dev/null
+++ b/crates/core/tedge_lib/src/notification.rs
@@ -0,0 +1,24 @@
+#[derive(Clone, Debug, serde::Serialize, serde::Deserialize, bevy_reflect::TypeUuid)]
+#[uuid = "54b0bde3-64e7-493f-83f5-db2caa0cd585"]
+#[non_exhaustive]
+pub enum Notification {
+ Info { message: String },
+
+ Warning { message: String },
+
+ Error { message: String },
+}
+
+impl Notification {
+ pub const fn info(message: String) -> Self {
+ Self::Info { message }
+ }
+ pub const fn warning(message: String) -> Self {
+ Self::Warning { message }
+ }
+ pub const fn error(message: String) -> Self {
+ Self::Error { message }
+ }
+}
+
+impl tedge_api::Message for Notification {}