diff options
| author | LLLL Colonq <llll@colonq> | 2026-08-18 00:08:28 -0400 |
|---|---|---|
| committer | LLLL Colonq <llll@colonq> | 2026-08-18 00:08:28 -0400 |
| commit | 32a62cfcb925225359a5c90761b795f2f737ebd2 (patch) | |
| tree | 95c2261964803b19f2d39cb35d8d514ed6e5a6f4 /2026/games_submissions/rpc2dot0/src/message.rs | |
| parent | de99c5f7636a952025ea13de02bafd25bcb6bdec (diff) | |
Re-populate games
Diffstat (limited to '2026/games_submissions/rpc2dot0/src/message.rs')
| -rw-r--r-- | 2026/games_submissions/rpc2dot0/src/message.rs | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/2026/games_submissions/rpc2dot0/src/message.rs b/2026/games_submissions/rpc2dot0/src/message.rs deleted file mode 100644 index d960b67..0000000 --- a/2026/games_submissions/rpc2dot0/src/message.rs +++ /dev/null @@ -1,26 +0,0 @@ -use serde::Serialize;
-use std::fmt::Debug;
-
-#[derive(Serialize, Debug)]
-pub struct Message<'a> {
- pub op: &'a str,
- #[serde(skip_serializing_if = "Option::is_none")]
- pub verb: Option<&'a str>,
- #[serde(skip_serializing_if = "Option::is_none")]
- pub win: Option<bool>,
- #[serde(skip_serializing_if = "Option::is_none")]
- pub score: Option<i32>,
- #[serde(skip_serializing_if = "Option::is_none")]
- pub video_url: Option<String>,
-}
-
-impl<'a> Message<'a> {
- pub fn post<MSG>(window: &web_sys::Window, msg: &MSG)
- where
- MSG: Serialize + Debug,
- {
- log::info!("eatyourgreens:: post message: {:?}", msg);
- let js_value = serde_wasm_bindgen::to_value(msg).unwrap();
- let _ = window.post_message(&js_value, "*");
- }
-}
|
