Skip to content

Instantly share code, notes, and snippets.

@ntakouris
Last active October 1, 2021 05:16
Show Gist options
  • Save ntakouris/a1b9ea2d5f89ef879a976d23b453c829 to your computer and use it in GitHub Desktop.
Save ntakouris/a1b9ea2d5f89ef879a976d23b453c829 to your computer and use it in GitHub Desktop.
use serde::{Serialize, Deserialize};
#[derive(Serialize, Deserialize, Clone, Debug)]
pub struct CaptionedImagePayload {
pub caption: String,
pub blob_storage_ref_id: String
}
#[derive(Serialize, Deserialize, Clone, Debug)]
pub enum DataResourcePayload {
String(String),
Float(f32),
Int(i32),
Bool(bool),
CaptionedImage(CaptionedImagePayload)
}
#[derive(Serialize, Deserialize, Clone, Debug)]
pub struct DataResource {
// whatever other metadata you need
pub id: String,
pub value: DataResourcePayload
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment