Created
September 1, 2018 17:57
-
-
Save jb55/23cc11a3f47c57e04446777e0dc4ad35 to your computer and use it in GitHub Desktop.
This file contains 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
#[derive(Debug, Serialize, Deserialize)] | |
#[serde(untagged)] | |
pub enum LinkOr<T> { | |
Link(String), | |
NotLink(T) | |
} | |
#[derive(Debug, Serialize, Deserialize)] | |
#[serde(untagged)] | |
pub enum Range<T> { | |
RangeField(LinkOr<T>), | |
RangeValues(Vec<LinkOr<T>>) | |
} | |
#[derive(Debug, Serialize, Deserialize)] | |
pub struct Object { | |
// add to activity as well | |
id: Option<String>, | |
name: Option<String>, | |
#[serde(rename = "type")] | |
type_: String, | |
actor: Option<Range<Box<Object>>>, | |
object: Option<Range<Box<Object>>>, | |
summary: Option<String>, | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment