mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-24 08:08:13 +08:00
- Move message handler payload data into structs
- Organize the file structure used by `editor/src/messages/portfolio/document` `/node_graph` and `/graph_operation`
- Make derive attributes use `serde::Serialize, serde::Deserialize` consistently instead of `use serde::{Deserialize, Serialize};` imports
- Various other code cleanup and refactoring
20 lines
382 B
Rust
20 lines
382 B
Rust
use crate::messages::prelude::*;
|
|
|
|
#[impl_message(Message, Broadcast)]
|
|
#[derive(PartialEq, Clone, Debug, serde::Serialize, serde::Deserialize)]
|
|
pub enum BroadcastMessage {
|
|
// Sub-messages
|
|
#[child]
|
|
TriggerEvent(BroadcastEvent),
|
|
|
|
// Messages
|
|
SubscribeEvent {
|
|
on: BroadcastEvent,
|
|
send: Box<Message>,
|
|
},
|
|
UnsubscribeEvent {
|
|
on: BroadcastEvent,
|
|
message: Box<Message>,
|
|
},
|
|
}
|