Created
September 30, 2021 14:37
-
-
Save ntakouris/a7a21d9476898cd468a0d3af273b6b2f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use serde::{Serialize, Deserialize}; | |
#[derive(Serialize, Deserialize, Debug)] | |
pub struct CaptionedImageValue { | |
pub caption: String, | |
pub contents_b64: String | |
} | |
#[derive(Serialize, Deserialize, Debug)] | |
#[serde(untagged)] | |
pub enum EventValue { | |
String(String), | |
Float(f32), | |
Int(i32), | |
Bool(bool), | |
CaptionedImage(CaptionedImageValue) | |
} | |
#[derive(Serialize, Deserialize, Debug)] | |
pub struct EventEntity { | |
// whatever other metadata you need | |
pub id: String, | |
pub value: EventValue | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment