mirror of
https://git.asonix.dog/asonix/activitystreams.git
synced 2024-11-22 11:51:00 +00:00
Add default impl for basically everything
This commit is contained in:
parent
3e64be3a23
commit
9bf393f142
42 changed files with 110 additions and 110 deletions
|
@ -24,7 +24,7 @@ use super::{kind::AcceptType, properties::ActivityProperties, Activity};
|
|||
use link::Link;
|
||||
use object::{Object, ObjectProperties};
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Serialize, Properties)]
|
||||
#[derive(Clone, Debug, Default, Deserialize, Serialize, Properties)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Accept {
|
||||
#[serde(rename = "type")]
|
||||
|
|
|
@ -24,7 +24,7 @@ use super::{kind::AddType, properties::ActivityProperties, Activity};
|
|||
use link::Link;
|
||||
use object::{Object, ObjectProperties};
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Serialize, Properties)]
|
||||
#[derive(Clone, Debug, Default, Deserialize, Serialize, Properties)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Add {
|
||||
#[serde(rename = "type")]
|
||||
|
|
|
@ -24,7 +24,7 @@ use super::{kind::MoveType, properties::ActivityProperties, Activity};
|
|||
use link::Link;
|
||||
use object::{Object, ObjectProperties};
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Serialize, Properties)]
|
||||
#[derive(Clone, Debug, Default, Deserialize, Serialize, Properties)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct AMove {
|
||||
#[serde(rename = "type")]
|
||||
|
|
|
@ -24,7 +24,7 @@ use super::{kind::AnnounceType, properties::ActivityProperties, Activity};
|
|||
use link::Link;
|
||||
use object::{Object, ObjectProperties};
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Serialize, Properties)]
|
||||
#[derive(Clone, Debug, Default, Deserialize, Serialize, Properties)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Announce {
|
||||
#[serde(rename = "type")]
|
||||
|
|
|
@ -24,7 +24,7 @@ use super::{kind::ArriveType, properties::ActivityProperties, Activity, Intransi
|
|||
use link::Link;
|
||||
use object::{Object, ObjectProperties};
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Serialize, Properties)]
|
||||
#[derive(Clone, Debug, Default, Deserialize, Serialize, Properties)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Arrive {
|
||||
#[serde(rename = "type")]
|
||||
|
|
|
@ -24,7 +24,7 @@ use super::{kind::BlockType, properties::ActivityProperties, Activity};
|
|||
use link::Link;
|
||||
use object::{Object, ObjectProperties};
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Serialize, Properties)]
|
||||
#[derive(Clone, Debug, Default, Deserialize, Serialize, Properties)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Block {
|
||||
#[serde(rename = "type")]
|
||||
|
|
|
@ -24,7 +24,7 @@ use super::{kind::CreateType, properties::ActivityProperties, Activity};
|
|||
use link::Link;
|
||||
use object::{Object, ObjectProperties};
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Serialize, Properties)]
|
||||
#[derive(Clone, Debug, Default, Deserialize, Serialize, Properties)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Create {
|
||||
#[serde(rename = "type")]
|
||||
|
|
|
@ -24,7 +24,7 @@ use super::{kind::DeleteType, properties::ActivityProperties, Activity};
|
|||
use link::Link;
|
||||
use object::{Object, ObjectProperties};
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Serialize, Properties)]
|
||||
#[derive(Clone, Debug, Default, Deserialize, Serialize, Properties)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Delete {
|
||||
#[serde(rename = "type")]
|
||||
|
|
|
@ -24,7 +24,7 @@ use super::{kind::DislikeType, properties::ActivityProperties, Activity};
|
|||
use link::Link;
|
||||
use object::{Object, ObjectProperties};
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Serialize, Properties)]
|
||||
#[derive(Clone, Debug, Default, Deserialize, Serialize, Properties)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Dislike {
|
||||
#[serde(rename = "type")]
|
||||
|
|
|
@ -24,7 +24,7 @@ use super::{kind::FlagType, properties::ActivityProperties, Activity};
|
|||
use link::Link;
|
||||
use object::{Object, ObjectProperties};
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Serialize, Properties)]
|
||||
#[derive(Clone, Debug, Default, Deserialize, Serialize, Properties)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Flag {
|
||||
#[serde(rename = "type")]
|
||||
|
|
|
@ -24,7 +24,7 @@ use super::{kind::FollowType, properties::ActivityProperties, Activity};
|
|||
use link::Link;
|
||||
use object::{Object, ObjectProperties};
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Serialize, Properties)]
|
||||
#[derive(Clone, Debug, Default, Deserialize, Serialize, Properties)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Follow {
|
||||
#[serde(rename = "type")]
|
||||
|
|
|
@ -24,7 +24,7 @@ use super::{kind::IgnoreType, properties::ActivityProperties, Activity};
|
|||
use link::Link;
|
||||
use object::{Object, ObjectProperties};
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Serialize, Properties)]
|
||||
#[derive(Clone, Debug, Default, Deserialize, Serialize, Properties)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Ignore {
|
||||
#[serde(rename = "type")]
|
||||
|
|
|
@ -24,7 +24,7 @@ use super::{kind::InviteType, properties::ActivityProperties, Activity};
|
|||
use link::Link;
|
||||
use object::{Object, ObjectProperties};
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Serialize, Properties)]
|
||||
#[derive(Clone, Debug, Default, Deserialize, Serialize, Properties)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Invite {
|
||||
#[serde(rename = "type")]
|
||||
|
|
|
@ -24,7 +24,7 @@ use super::{kind::JoinType, properties::ActivityProperties, Activity};
|
|||
use link::Link;
|
||||
use object::{Object, ObjectProperties};
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Serialize, Properties)]
|
||||
#[derive(Clone, Debug, Default, Deserialize, Serialize, Properties)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Join {
|
||||
#[serde(rename = "type")]
|
||||
|
|
|
@ -23,114 +23,114 @@ use serde::{
|
|||
de::{self, Deserialize, Deserializer, Visitor}, ser::{Serialize, Serializer},
|
||||
};
|
||||
|
||||
#[derive(Clone, Debug, UnitString)]
|
||||
#[derive(Clone, Debug, Default, UnitString)]
|
||||
#[activitystreams(Accept)]
|
||||
pub struct AcceptType;
|
||||
|
||||
#[derive(Clone, Debug, UnitString)]
|
||||
#[derive(Clone, Debug, Default, UnitString)]
|
||||
#[activitystreams(Add)]
|
||||
pub struct AddType;
|
||||
|
||||
#[derive(Clone, Debug, UnitString)]
|
||||
#[derive(Clone, Debug, Default, UnitString)]
|
||||
#[activitystreams(Move)]
|
||||
pub struct MoveType;
|
||||
|
||||
#[derive(Clone, Debug, UnitString)]
|
||||
#[derive(Clone, Debug, Default, UnitString)]
|
||||
#[activitystreams(Announce)]
|
||||
pub struct AnnounceType;
|
||||
|
||||
#[derive(Clone, Debug, UnitString)]
|
||||
#[derive(Clone, Debug, Default, UnitString)]
|
||||
#[activitystreams(Arrive)]
|
||||
pub struct ArriveType;
|
||||
|
||||
#[derive(Clone, Debug, UnitString)]
|
||||
#[derive(Clone, Debug, Default, UnitString)]
|
||||
#[activitystreams(Block)]
|
||||
pub struct BlockType;
|
||||
|
||||
#[derive(Clone, Debug, UnitString)]
|
||||
#[derive(Clone, Debug, Default, UnitString)]
|
||||
#[activitystreams(Create)]
|
||||
pub struct CreateType;
|
||||
|
||||
#[derive(Clone, Debug, UnitString)]
|
||||
#[derive(Clone, Debug, Default, UnitString)]
|
||||
#[activitystreams(Delete)]
|
||||
pub struct DeleteType;
|
||||
|
||||
#[derive(Clone, Debug, UnitString)]
|
||||
#[derive(Clone, Debug, Default, UnitString)]
|
||||
#[activitystreams(Dislike)]
|
||||
pub struct DislikeType;
|
||||
|
||||
#[derive(Clone, Debug, UnitString)]
|
||||
#[derive(Clone, Debug, Default, UnitString)]
|
||||
#[activitystreams(Flag)]
|
||||
pub struct FlagType;
|
||||
|
||||
#[derive(Clone, Debug, UnitString)]
|
||||
#[derive(Clone, Debug, Default, UnitString)]
|
||||
#[activitystreams(Follow)]
|
||||
pub struct FollowType;
|
||||
|
||||
#[derive(Clone, Debug, UnitString)]
|
||||
#[derive(Clone, Debug, Default, UnitString)]
|
||||
#[activitystreams(Ignore)]
|
||||
pub struct IgnoreType;
|
||||
|
||||
#[derive(Clone, Debug, UnitString)]
|
||||
#[derive(Clone, Debug, Default, UnitString)]
|
||||
#[activitystreams(Invite)]
|
||||
pub struct InviteType;
|
||||
|
||||
#[derive(Clone, Debug, UnitString)]
|
||||
#[derive(Clone, Debug, Default, UnitString)]
|
||||
#[activitystreams(Join)]
|
||||
pub struct JoinType;
|
||||
|
||||
#[derive(Clone, Debug, UnitString)]
|
||||
#[derive(Clone, Debug, Default, UnitString)]
|
||||
#[activitystreams(Leave)]
|
||||
pub struct LeaveType;
|
||||
|
||||
#[derive(Clone, Debug, UnitString)]
|
||||
#[derive(Clone, Debug, Default, UnitString)]
|
||||
#[activitystreams(Like)]
|
||||
pub struct LikeType;
|
||||
|
||||
#[derive(Clone, Debug, UnitString)]
|
||||
#[derive(Clone, Debug, Default, UnitString)]
|
||||
#[activitystreams(Listen)]
|
||||
pub struct ListenType;
|
||||
|
||||
#[derive(Clone, Debug, UnitString)]
|
||||
#[derive(Clone, Debug, Default, UnitString)]
|
||||
#[activitystreams(Offer)]
|
||||
pub struct OfferType;
|
||||
|
||||
#[derive(Clone, Debug, UnitString)]
|
||||
#[derive(Clone, Debug, Default, UnitString)]
|
||||
#[activitystreams(Question)]
|
||||
pub struct QuestionType;
|
||||
|
||||
#[derive(Clone, Debug, UnitString)]
|
||||
#[derive(Clone, Debug, Default, UnitString)]
|
||||
#[activitystreams(Real)]
|
||||
pub struct ReadType;
|
||||
|
||||
#[derive(Clone, Debug, UnitString)]
|
||||
#[derive(Clone, Debug, Default, UnitString)]
|
||||
#[activitystreams(Reject)]
|
||||
pub struct RejectType;
|
||||
|
||||
#[derive(Clone, Debug, UnitString)]
|
||||
#[derive(Clone, Debug, Default, UnitString)]
|
||||
#[activitystreams(Remove)]
|
||||
pub struct RemoveType;
|
||||
|
||||
#[derive(Clone, Debug, UnitString)]
|
||||
#[derive(Clone, Debug, Default, UnitString)]
|
||||
#[activitystreams(TentativeAccept)]
|
||||
pub struct TentativeAcceptType;
|
||||
|
||||
#[derive(Clone, Debug, UnitString)]
|
||||
#[derive(Clone, Debug, Default, UnitString)]
|
||||
#[activitystreams(TentativeReject)]
|
||||
pub struct TentativeRejectType;
|
||||
|
||||
#[derive(Clone, Debug, UnitString)]
|
||||
#[derive(Clone, Debug, Default, UnitString)]
|
||||
#[activitystreams(Travel)]
|
||||
pub struct TravelType;
|
||||
|
||||
#[derive(Clone, Debug, UnitString)]
|
||||
#[derive(Clone, Debug, Default, UnitString)]
|
||||
#[activitystreams(Undo)]
|
||||
pub struct UndoType;
|
||||
|
||||
#[derive(Clone, Debug, UnitString)]
|
||||
#[derive(Clone, Debug, Default, UnitString)]
|
||||
#[activitystreams(Update)]
|
||||
pub struct UpdateType;
|
||||
|
||||
#[derive(Clone, Debug, UnitString)]
|
||||
#[derive(Clone, Debug, Default, UnitString)]
|
||||
#[activitystreams(View)]
|
||||
pub struct ViewType;
|
||||
|
|
|
@ -24,7 +24,7 @@ use super::{kind::LeaveType, properties::ActivityProperties, Activity};
|
|||
use link::Link;
|
||||
use object::{Object, ObjectProperties};
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Serialize, Properties)]
|
||||
#[derive(Clone, Debug, Default, Deserialize, Serialize, Properties)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Leave {
|
||||
#[serde(rename = "type")]
|
||||
|
|
|
@ -24,7 +24,7 @@ use super::{kind::LikeType, properties::ActivityProperties, Activity};
|
|||
use link::Link;
|
||||
use object::{Object, ObjectProperties};
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Serialize, Properties)]
|
||||
#[derive(Clone, Debug, Default, Deserialize, Serialize, Properties)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Like {
|
||||
#[serde(rename = "type")]
|
||||
|
|
|
@ -24,7 +24,7 @@ use super::{kind::ListenType, properties::ActivityProperties, Activity};
|
|||
use link::Link;
|
||||
use object::{Object, ObjectProperties};
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Serialize, Properties)]
|
||||
#[derive(Clone, Debug, Default, Deserialize, Serialize, Properties)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Listen {
|
||||
#[serde(rename = "type")]
|
||||
|
|
|
@ -24,7 +24,7 @@ use super::{kind::OfferType, properties::ActivityProperties, Activity};
|
|||
use link::Link;
|
||||
use object::{Object, ObjectProperties};
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Serialize, Properties)]
|
||||
#[derive(Clone, Debug, Default, Deserialize, Serialize, Properties)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Offer {
|
||||
#[serde(rename = "type")]
|
||||
|
|
|
@ -22,7 +22,7 @@ use serde_json;
|
|||
use link::Link;
|
||||
use object::Object;
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Serialize, Properties)]
|
||||
#[derive(Clone, Debug, Default, Deserialize, Serialize, Properties)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct ActivityProperties {
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
|
|
|
@ -24,7 +24,7 @@ use super::{kind::QuestionType, properties::ActivityProperties, Activity, Intran
|
|||
use link::Link;
|
||||
use object::{Object, ObjectProperties};
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Serialize, Properties)]
|
||||
#[derive(Clone, Debug, Default, Deserialize, Serialize, Properties)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Question {
|
||||
#[serde(rename = "type")]
|
||||
|
|
|
@ -24,7 +24,7 @@ use super::{kind::ReadType, properties::ActivityProperties, Activity};
|
|||
use link::Link;
|
||||
use object::{Object, ObjectProperties};
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Serialize, Properties)]
|
||||
#[derive(Clone, Debug, Default, Deserialize, Serialize, Properties)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Read {
|
||||
#[serde(rename = "type")]
|
||||
|
|
|
@ -24,7 +24,7 @@ use super::{kind::RejectType, properties::ActivityProperties, Activity};
|
|||
use link::Link;
|
||||
use object::{Object, ObjectProperties};
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Serialize, Properties)]
|
||||
#[derive(Clone, Debug, Default, Deserialize, Serialize, Properties)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Reject {
|
||||
#[serde(rename = "type")]
|
||||
|
|
|
@ -24,7 +24,7 @@ use super::{kind::RemoveType, properties::ActivityProperties, Activity};
|
|||
use link::Link;
|
||||
use object::{Object, ObjectProperties};
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Serialize, Properties)]
|
||||
#[derive(Clone, Debug, Default, Deserialize, Serialize, Properties)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Remove {
|
||||
#[serde(rename = "type")]
|
||||
|
|
|
@ -24,7 +24,7 @@ use super::{kind::TentativeAcceptType, properties::ActivityProperties, Activity}
|
|||
use link::Link;
|
||||
use object::{Object, ObjectProperties};
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Serialize, Properties)]
|
||||
#[derive(Clone, Debug, Default, Deserialize, Serialize, Properties)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct TentativeAccept {
|
||||
#[serde(rename = "type")]
|
||||
|
|
|
@ -24,7 +24,7 @@ use super::{kind::TentativeRejectType, properties::ActivityProperties, Activity}
|
|||
use link::Link;
|
||||
use object::{Object, ObjectProperties};
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Serialize, Properties)]
|
||||
#[derive(Clone, Debug, Default, Deserialize, Serialize, Properties)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct TentativeReject {
|
||||
#[serde(rename = "type")]
|
||||
|
|
|
@ -24,7 +24,7 @@ use super::{kind::TravelType, properties::ActivityProperties, Activity, Intransi
|
|||
use link::Link;
|
||||
use object::{Object, ObjectProperties};
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Serialize, Properties)]
|
||||
#[derive(Clone, Debug, Default, Deserialize, Serialize, Properties)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Travel {
|
||||
#[serde(rename = "type")]
|
||||
|
|
|
@ -24,7 +24,7 @@ use super::{kind::UndoType, properties::ActivityProperties, Activity};
|
|||
use link::Link;
|
||||
use object::{Object, ObjectProperties};
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Serialize, Properties)]
|
||||
#[derive(Clone, Debug, Default, Deserialize, Serialize, Properties)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Undo {
|
||||
#[serde(rename = "type")]
|
||||
|
|
|
@ -24,7 +24,7 @@ use super::{kind::UpdateType, properties::ActivityProperties, Activity};
|
|||
use link::Link;
|
||||
use object::{Object, ObjectProperties};
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Serialize, Properties)]
|
||||
#[derive(Clone, Debug, Default, Deserialize, Serialize, Properties)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Update {
|
||||
#[serde(rename = "type")]
|
||||
|
|
|
@ -24,7 +24,7 @@ use super::{kind::ViewType, properties::ActivityProperties, Activity};
|
|||
use link::Link;
|
||||
use object::{Object, ObjectProperties};
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Serialize, Properties)]
|
||||
#[derive(Clone, Debug, Default, Deserialize, Serialize, Properties)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct View {
|
||||
#[serde(rename = "type")]
|
||||
|
|
|
@ -23,22 +23,22 @@ use serde::{
|
|||
de::{self, Deserialize, Deserializer, Visitor}, ser::{Serialize, Serializer},
|
||||
};
|
||||
|
||||
#[derive(Clone, Debug, UnitString)]
|
||||
#[derive(Clone, Debug, Default, UnitString)]
|
||||
#[activitystreams(Application)]
|
||||
pub struct ApplicationType;
|
||||
|
||||
#[derive(Clone, Debug, UnitString)]
|
||||
#[derive(Clone, Debug, Default, UnitString)]
|
||||
#[activitystreams(Group)]
|
||||
pub struct GroupType;
|
||||
|
||||
#[derive(Clone, Debug, UnitString)]
|
||||
#[derive(Clone, Debug, Default, UnitString)]
|
||||
#[activitystreams(Organization)]
|
||||
pub struct OrganizationType;
|
||||
|
||||
#[derive(Clone, Debug, UnitString)]
|
||||
#[derive(Clone, Debug, Default, UnitString)]
|
||||
#[activitystreams(Person)]
|
||||
pub struct PersonType;
|
||||
|
||||
#[derive(Clone, Debug, UnitString)]
|
||||
#[derive(Clone, Debug, Default, UnitString)]
|
||||
#[activitystreams(Service)]
|
||||
pub struct ServiceType;
|
||||
|
|
|
@ -24,7 +24,7 @@ pub use self::kind::*;
|
|||
|
||||
pub trait Actor: Object {}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Appliation {
|
||||
#[serde(rename = "type")]
|
||||
|
@ -36,7 +36,7 @@ pub struct Appliation {
|
|||
|
||||
impl Object for Appliation {}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Group {
|
||||
#[serde(rename = "type")]
|
||||
|
@ -48,7 +48,7 @@ pub struct Group {
|
|||
|
||||
impl Object for Group {}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Organization {
|
||||
#[serde(rename = "type")]
|
||||
|
@ -60,7 +60,7 @@ pub struct Organization {
|
|||
|
||||
impl Object for Organization {}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Person {
|
||||
#[serde(rename = "type")]
|
||||
|
@ -72,7 +72,7 @@ pub struct Person {
|
|||
|
||||
impl Object for Person {}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Service {
|
||||
#[serde(rename = "type")]
|
||||
|
|
|
@ -23,18 +23,18 @@ use serde::{
|
|||
de::{self, Deserialize, Deserializer, Visitor}, ser::{Serialize, Serializer},
|
||||
};
|
||||
|
||||
#[derive(Clone, Debug, UnitString)]
|
||||
#[derive(Clone, Debug, Default, UnitString)]
|
||||
#[activitystreams(Collection)]
|
||||
pub struct CollectionType;
|
||||
|
||||
#[derive(Clone, Debug, UnitString)]
|
||||
#[derive(Clone, Debug, Default, UnitString)]
|
||||
#[activitystreams(CollectionPage)]
|
||||
pub struct CollectionPageType;
|
||||
|
||||
#[derive(Clone, Debug, UnitString)]
|
||||
#[derive(Clone, Debug, Default, UnitString)]
|
||||
#[activitystreams(OrderedCollection)]
|
||||
pub struct OrderedCollectionType;
|
||||
|
||||
#[derive(Clone, Debug, UnitString)]
|
||||
#[derive(Clone, Debug, Default, UnitString)]
|
||||
#[activitystreams(OrderedCollectionPage)]
|
||||
pub struct OrderedCollectionPageType;
|
||||
|
|
|
@ -27,7 +27,7 @@ mod properties;
|
|||
pub use self::kind::*;
|
||||
pub use self::properties::*;
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Serialize, Properties)]
|
||||
#[derive(Clone, Debug, Default, Deserialize, Serialize, Properties)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Collection {
|
||||
#[serde(rename = "type")]
|
||||
|
@ -42,7 +42,7 @@ pub struct Collection {
|
|||
|
||||
impl Object for Collection {}
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Serialize, Properties)]
|
||||
#[derive(Clone, Debug, Default, Deserialize, Serialize, Properties)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct OrderedCollection {
|
||||
#[serde(rename = "type")]
|
||||
|
@ -57,7 +57,7 @@ pub struct OrderedCollection {
|
|||
|
||||
impl Object for OrderedCollection {}
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Serialize, Properties)]
|
||||
#[derive(Clone, Debug, Default, Deserialize, Serialize, Properties)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct CollectionPage {
|
||||
#[serde(rename = "type")]
|
||||
|
@ -75,7 +75,7 @@ pub struct CollectionPage {
|
|||
|
||||
impl Object for CollectionPage {}
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Serialize, Properties)]
|
||||
#[derive(Clone, Debug, Default, Deserialize, Serialize, Properties)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct OrderedCollectionPage {
|
||||
#[serde(rename = "type")]
|
||||
|
|
|
@ -22,7 +22,7 @@ use serde_json;
|
|||
use super::{Collection, CollectionPage};
|
||||
use link::Link;
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Serialize, Properties)]
|
||||
#[derive(Clone, Debug, Default, Deserialize, Serialize, Properties)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct CollectionProperties {
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
|
@ -42,7 +42,7 @@ pub struct CollectionProperties {
|
|||
last: Option<serde_json::Value>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Serialize, Properties)]
|
||||
#[derive(Clone, Debug, Default, Deserialize, Serialize, Properties)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct CollectionPageProperties {
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
|
@ -58,7 +58,7 @@ pub struct CollectionPageProperties {
|
|||
prev: Option<serde_json::Value>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Serialize, Properties)]
|
||||
#[derive(Clone, Debug, Default, Deserialize, Serialize, Properties)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct OrderedCollectionPageProperties {
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
|
|
|
@ -24,7 +24,7 @@ use object::Object;
|
|||
#[serde(rename_all = "camelCase")]
|
||||
pub struct CustomLink<C, L> {
|
||||
#[serde(flatten)]
|
||||
link: L,
|
||||
pub link: L,
|
||||
|
||||
#[serde(flatten)]
|
||||
pub custom_props: C,
|
||||
|
@ -40,7 +40,7 @@ impl<C, L: Link> CustomLink<C, L> {
|
|||
#[serde(rename_all = "camelCase")]
|
||||
pub struct CustomObject<C, O> {
|
||||
#[serde(flatten)]
|
||||
object: O,
|
||||
pub object: O,
|
||||
|
||||
#[serde(flatten)]
|
||||
pub custom_props: C,
|
||||
|
|
|
@ -23,6 +23,6 @@ use serde::{
|
|||
de::{self, Deserialize, Deserializer, Visitor}, ser::{Serialize, Serializer},
|
||||
};
|
||||
|
||||
#[derive(Clone, Debug, UnitString)]
|
||||
#[derive(Clone, Debug, Default, UnitString)]
|
||||
#[activitystreams(Mention)]
|
||||
pub struct MentionType;
|
||||
|
|
|
@ -26,7 +26,7 @@ pub use self::properties::*;
|
|||
|
||||
pub trait Link: DeserializeOwned + Serialize {}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Mention {
|
||||
#[serde(rename = "type")]
|
||||
|
|
|
@ -24,7 +24,7 @@ use error::{Error, Result};
|
|||
use link::Link;
|
||||
use object::Object;
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, Properties)]
|
||||
#[derive(Clone, Debug, Default, Deserialize, Serialize, Properties)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct LinkProperties {
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
|
|
|
@ -23,50 +23,50 @@ use serde::{
|
|||
de::{self, Deserialize, Deserializer, Visitor}, ser::{Serialize, Serializer},
|
||||
};
|
||||
|
||||
#[derive(Clone, Debug, UnitString)]
|
||||
#[derive(Clone, Debug, Default, UnitString)]
|
||||
#[activitystreams(Article)]
|
||||
pub struct ArticleType;
|
||||
|
||||
#[derive(Clone, Debug, UnitString)]
|
||||
#[derive(Clone, Debug, Default, UnitString)]
|
||||
#[activitystreams(Audio)]
|
||||
pub struct AudioType;
|
||||
|
||||
#[derive(Clone, Debug, UnitString)]
|
||||
#[derive(Clone, Debug, Default, UnitString)]
|
||||
#[activitystreams(Document)]
|
||||
pub struct DocumentType;
|
||||
|
||||
#[derive(Clone, Debug, UnitString)]
|
||||
#[derive(Clone, Debug, Default, UnitString)]
|
||||
#[activitystreams(Event)]
|
||||
pub struct EventType;
|
||||
|
||||
#[derive(Clone, Debug, UnitString)]
|
||||
#[derive(Clone, Debug, Default, UnitString)]
|
||||
#[activitystreams(Image)]
|
||||
pub struct ImageType;
|
||||
|
||||
#[derive(Clone, Debug, UnitString)]
|
||||
#[derive(Clone, Debug, Default, UnitString)]
|
||||
#[activitystreams(Note)]
|
||||
pub struct NoteType;
|
||||
|
||||
#[derive(Clone, Debug, UnitString)]
|
||||
#[derive(Clone, Debug, Default, UnitString)]
|
||||
#[activitystreams(Page)]
|
||||
pub struct PageType;
|
||||
|
||||
#[derive(Clone, Debug, UnitString)]
|
||||
#[derive(Clone, Debug, Default, UnitString)]
|
||||
#[activitystreams(Place)]
|
||||
pub struct PlaceType;
|
||||
|
||||
#[derive(Clone, Debug, UnitString)]
|
||||
#[derive(Clone, Debug, Default, UnitString)]
|
||||
#[activitystreams(Profile)]
|
||||
pub struct ProfileType;
|
||||
|
||||
#[derive(Clone, Debug, UnitString)]
|
||||
#[derive(Clone, Debug, Default, UnitString)]
|
||||
#[activitystreams(Relationship)]
|
||||
pub struct RelationshipType;
|
||||
|
||||
#[derive(Clone, Debug, UnitString)]
|
||||
#[derive(Clone, Debug, Default, UnitString)]
|
||||
#[activitystreams(Tombstone)]
|
||||
pub struct TombstoneType;
|
||||
|
||||
#[derive(Clone, Debug, UnitString)]
|
||||
#[derive(Clone, Debug, Default, UnitString)]
|
||||
#[activitystreams(Video)]
|
||||
pub struct VideoType;
|
||||
|
|
|
@ -29,7 +29,7 @@ pub use self::properties::*;
|
|||
|
||||
pub trait Object: DeserializeOwned + Serialize {}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Article {
|
||||
#[serde(rename = "type")]
|
||||
|
@ -41,7 +41,7 @@ pub struct Article {
|
|||
|
||||
impl Object for Article {}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Audio {
|
||||
#[serde(rename = "type")]
|
||||
|
@ -53,7 +53,7 @@ pub struct Audio {
|
|||
|
||||
impl Object for Audio {}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Document {
|
||||
#[serde(rename = "type")]
|
||||
|
@ -65,7 +65,7 @@ pub struct Document {
|
|||
|
||||
impl Object for Document {}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Event {
|
||||
#[serde(rename = "type")]
|
||||
|
@ -77,7 +77,7 @@ pub struct Event {
|
|||
|
||||
impl Object for Event {}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Image {
|
||||
#[serde(rename = "type")]
|
||||
|
@ -89,7 +89,7 @@ pub struct Image {
|
|||
|
||||
impl Object for Image {}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Note {
|
||||
#[serde(rename = "type")]
|
||||
|
@ -101,7 +101,7 @@ pub struct Note {
|
|||
|
||||
impl Object for Note {}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Page {
|
||||
#[serde(rename = "type")]
|
||||
|
@ -113,7 +113,7 @@ pub struct Page {
|
|||
|
||||
impl Object for Page {}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Place {
|
||||
#[serde(rename = "type")]
|
||||
|
@ -128,7 +128,7 @@ pub struct Place {
|
|||
|
||||
impl Object for Place {}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, Properties)]
|
||||
#[derive(Clone, Debug, Default, Deserialize, Serialize, Properties)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Profile {
|
||||
#[serde(rename = "type")]
|
||||
|
@ -143,7 +143,7 @@ pub struct Profile {
|
|||
|
||||
impl Object for Profile {}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, Properties)]
|
||||
#[derive(Clone, Debug, Default, Deserialize, Serialize, Properties)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Relationship {
|
||||
#[serde(rename = "type")]
|
||||
|
@ -164,7 +164,7 @@ pub struct Relationship {
|
|||
|
||||
impl Object for Relationship {}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Tombstone {
|
||||
#[serde(rename = "type")]
|
||||
|
@ -179,7 +179,7 @@ pub struct Tombstone {
|
|||
|
||||
impl Object for Tombstone {}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Video {
|
||||
#[serde(rename = "type")]
|
||||
|
|
|
@ -28,7 +28,7 @@ use object::{Image, Object};
|
|||
|
||||
pub type UtcTime = DateTime<Utc>;
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, Properties)]
|
||||
#[derive(Clone, Debug, Default, Deserialize, Serialize, Properties)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct ObjectProperties {
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
|
@ -148,7 +148,7 @@ impl ObjectProperties {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, Properties)]
|
||||
#[derive(Clone, Debug, Default, Deserialize, Serialize, Properties)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct PlaceProperties {
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
|
@ -172,7 +172,7 @@ pub struct PlaceProperties {
|
|||
radius: Option<serde_json::Value>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, Properties)]
|
||||
#[derive(Clone, Debug, Default, Deserialize, Serialize, Properties)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct TombstoneProperties {
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
|
|
Loading…
Reference in a new issue