rrpack_prime/transparent/alert/
state.rs

1use rill_protocol::flow::core::Flow;
2use rill_protocol::io::provider::StreamType;
3use rrpack_basis::manifest::description::{Layer, PackFlow};
4use serde::{Deserialize, Serialize};
5
6#[derive(Debug, Clone, Serialize, Deserialize)]
7pub struct AlertSpec {}
8
9#[derive(Debug, Clone, Serialize, Deserialize)]
10pub struct AlertState {
11    // TODO: Decide: persistent or not?
12}
13
14impl From<AlertSpec> for AlertState {
15    fn from(_spec: AlertSpec) -> Self {
16        Self {}
17    }
18}
19
20impl PackFlow for AlertState {
21    fn layer() -> Layer {
22        Layer::Transparent
23    }
24}
25
26impl Flow for AlertState {
27    type Action = AlertAction;
28    type Event = AlertEvent;
29
30    fn stream_type() -> StreamType {
31        StreamType::from(module_path!())
32    }
33
34    fn apply(&mut self, _event: Self::Event) {}
35}
36
37pub type AlertAction = ();
38
39#[derive(Debug, Clone, Serialize, Deserialize)]
40pub enum AlertEvent {
41    Notify { text: String },
42}