mirror of
https://git.asonix.dog/asonix/activitystreams.git
synced 2024-11-25 13:21:00 +00:00
Move Extension traits out of properties modules
This commit is contained in:
parent
16d06bf550
commit
ef7ebb8db2
41 changed files with 124 additions and 101 deletions
|
@ -21,9 +21,10 @@ use activitystreams_traits::{Activity, Object};
|
||||||
|
|
||||||
use super::{
|
use super::{
|
||||||
kind::AcceptType,
|
kind::AcceptType,
|
||||||
properties::{AcceptProperties, ActivityExt, ActivityProperties},
|
properties::{AcceptProperties, ActivityProperties},
|
||||||
|
ActivityExt,
|
||||||
};
|
};
|
||||||
use object::properties::{ObjectExt, ObjectProperties};
|
use object::{properties::ObjectProperties, ObjectExt};
|
||||||
|
|
||||||
/// Indicates that the actor accepts the object.
|
/// Indicates that the actor accepts the object.
|
||||||
///
|
///
|
||||||
|
|
|
@ -21,9 +21,10 @@ use activitystreams_traits::{Activity, Object};
|
||||||
|
|
||||||
use super::{
|
use super::{
|
||||||
kind::AddType,
|
kind::AddType,
|
||||||
properties::{ActivityExt, ActivityProperties, AddProperties},
|
properties::{ActivityProperties, AddProperties},
|
||||||
|
ActivityExt,
|
||||||
};
|
};
|
||||||
use object::properties::{ObjectExt, ObjectProperties};
|
use object::{properties::ObjectProperties, ObjectExt};
|
||||||
|
|
||||||
/// Indicates that the actor has added the object to the target.
|
/// Indicates that the actor has added the object to the target.
|
||||||
///
|
///
|
||||||
|
|
|
@ -21,9 +21,10 @@ use activitystreams_traits::{Activity, Object};
|
||||||
|
|
||||||
use super::{
|
use super::{
|
||||||
kind::MoveType,
|
kind::MoveType,
|
||||||
properties::{ActivityExt, ActivityProperties, MoveProperties},
|
properties::{ActivityProperties, MoveProperties},
|
||||||
|
ActivityExt,
|
||||||
};
|
};
|
||||||
use object::properties::{ObjectExt, ObjectProperties};
|
use object::{properties::ObjectProperties, ObjectExt};
|
||||||
|
|
||||||
/// Indicates that the actor has moved object from origin to target.
|
/// Indicates that the actor has moved object from origin to target.
|
||||||
///
|
///
|
||||||
|
|
|
@ -21,9 +21,10 @@ use activitystreams_traits::{Activity, Object};
|
||||||
|
|
||||||
use super::{
|
use super::{
|
||||||
kind::AnnounceType,
|
kind::AnnounceType,
|
||||||
properties::{ActivityExt, ActivityProperties, AnnounceProperties},
|
properties::{ActivityProperties, AnnounceProperties},
|
||||||
|
ActivityExt,
|
||||||
};
|
};
|
||||||
use object::properties::{ObjectExt, ObjectProperties};
|
use object::{properties::ObjectProperties, ObjectExt};
|
||||||
|
|
||||||
/// Indicates that the actor is calling the target's attention the object.
|
/// Indicates that the actor is calling the target's attention the object.
|
||||||
///
|
///
|
||||||
|
|
|
@ -21,9 +21,10 @@ use activitystreams_traits::{Activity, IntransitiveActivity, Object};
|
||||||
|
|
||||||
use super::{
|
use super::{
|
||||||
kind::ArriveType,
|
kind::ArriveType,
|
||||||
properties::{ActivityExt, ActivityProperties, ArriveProperties},
|
properties::{ActivityProperties, ArriveProperties},
|
||||||
|
ActivityExt,
|
||||||
};
|
};
|
||||||
use object::properties::{ObjectExt, ObjectProperties};
|
use object::{properties::ObjectProperties, ObjectExt};
|
||||||
|
|
||||||
/// An IntransitiveActivity that indicates that the actor has arrived at the location.
|
/// An IntransitiveActivity that indicates that the actor has arrived at the location.
|
||||||
///
|
///
|
||||||
|
|
|
@ -21,9 +21,10 @@ use activitystreams_traits::{Activity, Object};
|
||||||
|
|
||||||
use super::{
|
use super::{
|
||||||
kind::BlockType,
|
kind::BlockType,
|
||||||
properties::{ActivityExt, ActivityProperties, BlockProperties},
|
properties::{ActivityProperties, BlockProperties},
|
||||||
|
ActivityExt,
|
||||||
};
|
};
|
||||||
use object::properties::{ObjectExt, ObjectProperties};
|
use object::{properties::ObjectProperties, ObjectExt};
|
||||||
|
|
||||||
/// Indicates that the actor is blocking the object.
|
/// Indicates that the actor is blocking the object.
|
||||||
///
|
///
|
||||||
|
|
|
@ -21,9 +21,10 @@ use activitystreams_traits::{Activity, Object};
|
||||||
|
|
||||||
use super::{
|
use super::{
|
||||||
kind::CreateType,
|
kind::CreateType,
|
||||||
properties::{ActivityExt, ActivityProperties, CreateProperties},
|
properties::{ActivityProperties, CreateProperties},
|
||||||
|
ActivityExt,
|
||||||
};
|
};
|
||||||
use object::properties::{ObjectExt, ObjectProperties};
|
use object::{properties::ObjectProperties, ObjectExt};
|
||||||
|
|
||||||
/// Indicates that the actor has created the object.
|
/// Indicates that the actor has created the object.
|
||||||
#[derive(Clone, Debug, Default, Deserialize, Serialize, Properties)]
|
#[derive(Clone, Debug, Default, Deserialize, Serialize, Properties)]
|
||||||
|
|
|
@ -21,9 +21,10 @@ use activitystreams_traits::{Activity, Object};
|
||||||
|
|
||||||
use super::{
|
use super::{
|
||||||
kind::DeleteType,
|
kind::DeleteType,
|
||||||
properties::{ActivityExt, ActivityProperties, DeleteProperties},
|
properties::{ActivityProperties, DeleteProperties},
|
||||||
|
ActivityExt,
|
||||||
};
|
};
|
||||||
use object::properties::{ObjectExt, ObjectProperties};
|
use object::{properties::ObjectProperties, ObjectExt};
|
||||||
|
|
||||||
/// Indicates that the actor has deleted the object.
|
/// Indicates that the actor has deleted the object.
|
||||||
///
|
///
|
||||||
|
|
|
@ -21,9 +21,10 @@ use activitystreams_traits::{Activity, Object};
|
||||||
|
|
||||||
use super::{
|
use super::{
|
||||||
kind::DislikeType,
|
kind::DislikeType,
|
||||||
properties::{ActivityExt, ActivityProperties, DislikeProperties},
|
properties::{ActivityProperties, DislikeProperties},
|
||||||
|
ActivityExt,
|
||||||
};
|
};
|
||||||
use object::properties::{ObjectExt, ObjectProperties};
|
use object::{properties::ObjectProperties, ObjectExt};
|
||||||
|
|
||||||
/// Indicates that the actor dislikes the object.
|
/// Indicates that the actor dislikes the object.
|
||||||
#[derive(Clone, Debug, Default, Deserialize, Serialize, Properties)]
|
#[derive(Clone, Debug, Default, Deserialize, Serialize, Properties)]
|
||||||
|
|
|
@ -21,9 +21,10 @@ use activitystreams_traits::{Activity, Object};
|
||||||
|
|
||||||
use super::{
|
use super::{
|
||||||
kind::FlagType,
|
kind::FlagType,
|
||||||
properties::{ActivityExt, ActivityProperties, FlagProperties},
|
properties::{ActivityProperties, FlagProperties},
|
||||||
|
ActivityExt,
|
||||||
};
|
};
|
||||||
use object::properties::{ObjectExt, ObjectProperties};
|
use object::{properties::ObjectProperties, ObjectExt};
|
||||||
|
|
||||||
/// Indicates that the actor is "flagging" the object.
|
/// Indicates that the actor is "flagging" the object.
|
||||||
///
|
///
|
||||||
|
|
|
@ -21,9 +21,10 @@ use activitystreams_traits::{Activity, Object};
|
||||||
|
|
||||||
use super::{
|
use super::{
|
||||||
kind::FollowType,
|
kind::FollowType,
|
||||||
properties::{ActivityExt, ActivityProperties, FollowProperties},
|
properties::{ActivityProperties, FollowProperties},
|
||||||
|
ActivityExt,
|
||||||
};
|
};
|
||||||
use object::properties::{ObjectExt, ObjectProperties};
|
use object::{properties::ObjectProperties, ObjectExt};
|
||||||
|
|
||||||
/// Indicates that the actor is "following" the object.
|
/// Indicates that the actor is "following" the object.
|
||||||
///
|
///
|
||||||
|
|
|
@ -21,9 +21,10 @@ use activitystreams_traits::{Activity, Object};
|
||||||
|
|
||||||
use super::{
|
use super::{
|
||||||
kind::IgnoreType,
|
kind::IgnoreType,
|
||||||
properties::{ActivityExt, ActivityProperties, IgnoreProperties},
|
properties::{ActivityProperties, IgnoreProperties},
|
||||||
|
ActivityExt,
|
||||||
};
|
};
|
||||||
use object::properties::{ObjectExt, ObjectProperties};
|
use object::{properties::ObjectProperties, ObjectExt};
|
||||||
|
|
||||||
/// Indicates that the actor is ignoring the object.
|
/// Indicates that the actor is ignoring the object.
|
||||||
///
|
///
|
||||||
|
|
|
@ -21,9 +21,10 @@ use activitystreams_traits::{Activity, Object};
|
||||||
|
|
||||||
use super::{
|
use super::{
|
||||||
kind::InviteType,
|
kind::InviteType,
|
||||||
properties::{ActivityExt, ActivityProperties, InviteProperties},
|
properties::{ActivityProperties, InviteProperties},
|
||||||
|
ActivityExt,
|
||||||
};
|
};
|
||||||
use object::properties::{ObjectExt, ObjectProperties};
|
use object::{properties::ObjectProperties, ObjectExt};
|
||||||
|
|
||||||
/// A specialization of Offer in which the actor is extending an invitation for the object to the
|
/// A specialization of Offer in which the actor is extending an invitation for the object to the
|
||||||
/// target.
|
/// target.
|
||||||
|
|
|
@ -21,9 +21,10 @@ use activitystreams_traits::{Activity, Object};
|
||||||
|
|
||||||
use super::{
|
use super::{
|
||||||
kind::JoinType,
|
kind::JoinType,
|
||||||
properties::{ActivityExt, ActivityProperties, JoinProperties},
|
properties::{ActivityProperties, JoinProperties},
|
||||||
|
ActivityExt,
|
||||||
};
|
};
|
||||||
use object::properties::{ObjectExt, ObjectProperties};
|
use object::{properties::ObjectProperties, ObjectExt};
|
||||||
|
|
||||||
/// Indicates that the actor has joined the object.
|
/// Indicates that the actor has joined the object.
|
||||||
///
|
///
|
||||||
|
|
|
@ -21,9 +21,10 @@ use activitystreams_traits::{Activity, Object};
|
||||||
|
|
||||||
use super::{
|
use super::{
|
||||||
kind::LeaveType,
|
kind::LeaveType,
|
||||||
properties::{ActivityExt, ActivityProperties, LeaveProperties},
|
properties::{ActivityProperties, LeaveProperties},
|
||||||
|
ActivityExt,
|
||||||
};
|
};
|
||||||
use object::properties::{ObjectExt, ObjectProperties};
|
use object::{properties::ObjectProperties, ObjectExt};
|
||||||
|
|
||||||
/// Indicates that the actor has left the object.
|
/// Indicates that the actor has left the object.
|
||||||
///
|
///
|
||||||
|
|
|
@ -21,9 +21,10 @@ use activitystreams_traits::{Activity, Object};
|
||||||
|
|
||||||
use super::{
|
use super::{
|
||||||
kind::LikeType,
|
kind::LikeType,
|
||||||
properties::{ActivityExt, ActivityProperties, LikeProperties},
|
properties::{ActivityProperties, LikeProperties},
|
||||||
|
ActivityExt,
|
||||||
};
|
};
|
||||||
use object::properties::{ObjectExt, ObjectProperties};
|
use object::{properties::ObjectProperties, ObjectExt};
|
||||||
|
|
||||||
/// Indicates that the actor likes, recommends or endorses the object.
|
/// Indicates that the actor likes, recommends or endorses the object.
|
||||||
///
|
///
|
||||||
|
|
|
@ -21,9 +21,10 @@ use activitystreams_traits::{Activity, Object};
|
||||||
|
|
||||||
use super::{
|
use super::{
|
||||||
kind::ListenType,
|
kind::ListenType,
|
||||||
properties::{ActivityExt, ActivityProperties, ListenProperties},
|
properties::{ActivityProperties, ListenProperties},
|
||||||
|
ActivityExt,
|
||||||
};
|
};
|
||||||
use object::properties::{ObjectExt, ObjectProperties};
|
use object::{properties::ObjectProperties, ObjectExt};
|
||||||
|
|
||||||
/// Indicates that the actor has listened to the object.
|
/// Indicates that the actor has listened to the object.
|
||||||
#[derive(Clone, Debug, Default, Deserialize, Serialize, Properties)]
|
#[derive(Clone, Debug, Default, Deserialize, Serialize, Properties)]
|
||||||
|
|
|
@ -76,3 +76,12 @@ pub use self::travel::*;
|
||||||
pub use self::undo::*;
|
pub use self::undo::*;
|
||||||
pub use self::update::*;
|
pub use self::update::*;
|
||||||
pub use self::view::*;
|
pub use self::view::*;
|
||||||
|
|
||||||
|
use activitystreams_traits::Activity;
|
||||||
|
|
||||||
|
use self::properties::ActivityProperties;
|
||||||
|
|
||||||
|
pub trait ActivityExt: Activity {
|
||||||
|
fn props(&self) -> &ActivityProperties;
|
||||||
|
fn props_mut(&mut self) -> &mut ActivityProperties;
|
||||||
|
}
|
||||||
|
|
|
@ -21,9 +21,10 @@ use activitystreams_traits::{Activity, Object};
|
||||||
|
|
||||||
use super::{
|
use super::{
|
||||||
kind::OfferType,
|
kind::OfferType,
|
||||||
properties::{ActivityExt, ActivityProperties, OfferProperties},
|
properties::{ActivityProperties, OfferProperties},
|
||||||
|
ActivityExt,
|
||||||
};
|
};
|
||||||
use object::properties::{ObjectExt, ObjectProperties};
|
use object::{properties::ObjectProperties, ObjectExt};
|
||||||
|
|
||||||
/// Indicates that the actor is offering the object.
|
/// Indicates that the actor is offering the object.
|
||||||
///
|
///
|
||||||
|
|
|
@ -56,14 +56,9 @@
|
||||||
//! # fn main() {}
|
//! # fn main() {}
|
||||||
//! ```
|
//! ```
|
||||||
|
|
||||||
use activitystreams_traits::{Activity, Link, Object};
|
use activitystreams_traits::{Link, Object};
|
||||||
use serde_json;
|
use serde_json;
|
||||||
|
|
||||||
pub trait ActivityExt: Activity {
|
|
||||||
fn props(&self) -> &ActivityProperties;
|
|
||||||
fn props_mut(&mut self) -> &mut ActivityProperties;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Activity objects are specializations of the base Object type that provide information about
|
/// Activity objects are specializations of the base Object type that provide information about
|
||||||
/// actions that have either already occurred, are in the process of occurring, or may occur in the
|
/// actions that have either already occurred, are in the process of occurring, or may occur in the
|
||||||
/// future.
|
/// future.
|
||||||
|
|
|
@ -21,9 +21,10 @@ use activitystreams_traits::{Activity, IntransitiveActivity, Object};
|
||||||
|
|
||||||
use super::{
|
use super::{
|
||||||
kind::QuestionType,
|
kind::QuestionType,
|
||||||
properties::{ActivityExt, ActivityProperties, QuestionProperties},
|
properties::{ActivityProperties, QuestionProperties},
|
||||||
|
ActivityExt,
|
||||||
};
|
};
|
||||||
use object::properties::{ObjectExt, ObjectProperties};
|
use object::{properties::ObjectProperties, ObjectExt};
|
||||||
|
|
||||||
/// Represents a question being asked.
|
/// Represents a question being asked.
|
||||||
///
|
///
|
||||||
|
|
|
@ -21,9 +21,10 @@ use activitystreams_traits::{Activity, Object};
|
||||||
|
|
||||||
use super::{
|
use super::{
|
||||||
kind::ReadType,
|
kind::ReadType,
|
||||||
properties::{ActivityExt, ActivityProperties, ReadProperties},
|
properties::{ActivityProperties, ReadProperties},
|
||||||
|
ActivityExt,
|
||||||
};
|
};
|
||||||
use object::properties::{ObjectExt, ObjectProperties};
|
use object::{properties::ObjectProperties, ObjectExt};
|
||||||
|
|
||||||
/// Indicates that the actor has read the object.
|
/// Indicates that the actor has read the object.
|
||||||
#[derive(Clone, Debug, Default, Deserialize, Serialize, Properties)]
|
#[derive(Clone, Debug, Default, Deserialize, Serialize, Properties)]
|
||||||
|
|
|
@ -21,9 +21,10 @@ use activitystreams_traits::{Activity, Object};
|
||||||
|
|
||||||
use super::{
|
use super::{
|
||||||
kind::RejectType,
|
kind::RejectType,
|
||||||
properties::{ActivityExt, ActivityProperties, RejectProperties},
|
properties::{ActivityProperties, RejectProperties},
|
||||||
|
ActivityExt,
|
||||||
};
|
};
|
||||||
use object::properties::{ObjectExt, ObjectProperties};
|
use object::{properties::ObjectProperties, ObjectExt};
|
||||||
|
|
||||||
/// Indicates that the actor is rejecting the object.
|
/// Indicates that the actor is rejecting the object.
|
||||||
///
|
///
|
||||||
|
|
|
@ -21,9 +21,10 @@ use activitystreams_traits::{Activity, Object};
|
||||||
|
|
||||||
use super::{
|
use super::{
|
||||||
kind::RemoveType,
|
kind::RemoveType,
|
||||||
properties::{ActivityExt, ActivityProperties, RemoveProperties},
|
properties::{ActivityProperties, RemoveProperties},
|
||||||
|
ActivityExt,
|
||||||
};
|
};
|
||||||
use object::properties::{ObjectExt, ObjectProperties};
|
use object::{properties::ObjectProperties, ObjectExt};
|
||||||
|
|
||||||
/// Indicates that the actor is removing the object.
|
/// Indicates that the actor is removing the object.
|
||||||
///
|
///
|
||||||
|
|
|
@ -21,9 +21,10 @@ use activitystreams_traits::{Activity, Object};
|
||||||
|
|
||||||
use super::{
|
use super::{
|
||||||
kind::TentativeAcceptType,
|
kind::TentativeAcceptType,
|
||||||
properties::{ActivityExt, ActivityProperties, TentativeAcceptProperties},
|
properties::{ActivityProperties, TentativeAcceptProperties},
|
||||||
|
ActivityExt,
|
||||||
};
|
};
|
||||||
use object::properties::{ObjectExt, ObjectProperties};
|
use object::{properties::ObjectProperties, ObjectExt};
|
||||||
|
|
||||||
/// A specialization of Accept indicating that the acceptance is tentative.
|
/// A specialization of Accept indicating that the acceptance is tentative.
|
||||||
#[derive(Clone, Debug, Default, Deserialize, Serialize, Properties)]
|
#[derive(Clone, Debug, Default, Deserialize, Serialize, Properties)]
|
||||||
|
|
|
@ -21,9 +21,10 @@ use activitystreams_traits::{Activity, Object};
|
||||||
|
|
||||||
use super::{
|
use super::{
|
||||||
kind::TentativeRejectType,
|
kind::TentativeRejectType,
|
||||||
properties::{ActivityExt, ActivityProperties, TentativeRejectProperties},
|
properties::{ActivityProperties, TentativeRejectProperties},
|
||||||
|
ActivityExt,
|
||||||
};
|
};
|
||||||
use object::properties::{ObjectExt, ObjectProperties};
|
use object::{properties::ObjectProperties, ObjectExt};
|
||||||
|
|
||||||
/// A specialization of Reject in which the rejection is considered tentative.
|
/// A specialization of Reject in which the rejection is considered tentative.
|
||||||
#[derive(Clone, Debug, Default, Deserialize, Serialize, Properties)]
|
#[derive(Clone, Debug, Default, Deserialize, Serialize, Properties)]
|
||||||
|
|
|
@ -21,9 +21,10 @@ use activitystreams_traits::{Activity, IntransitiveActivity, Object};
|
||||||
|
|
||||||
use super::{
|
use super::{
|
||||||
kind::TravelType,
|
kind::TravelType,
|
||||||
properties::{ActivityExt, ActivityProperties, TravelProperties},
|
properties::{ActivityProperties, TravelProperties},
|
||||||
|
ActivityExt,
|
||||||
};
|
};
|
||||||
use object::properties::{ObjectExt, ObjectProperties};
|
use object::{properties::ObjectProperties, ObjectExt};
|
||||||
|
|
||||||
/// Indicates that the actor is traveling to target from origin.
|
/// Indicates that the actor is traveling to target from origin.
|
||||||
///
|
///
|
||||||
|
|
|
@ -21,9 +21,10 @@ use activitystreams_traits::{Activity, Object};
|
||||||
|
|
||||||
use super::{
|
use super::{
|
||||||
kind::UndoType,
|
kind::UndoType,
|
||||||
properties::{ActivityExt, ActivityProperties, UndoProperties},
|
properties::{ActivityProperties, UndoProperties},
|
||||||
|
ActivityExt,
|
||||||
};
|
};
|
||||||
use object::properties::{ObjectExt, ObjectProperties};
|
use object::{properties::ObjectProperties, ObjectExt};
|
||||||
|
|
||||||
/// Indicates that the actor is undoing the object.
|
/// Indicates that the actor is undoing the object.
|
||||||
///
|
///
|
||||||
|
|
|
@ -21,9 +21,10 @@ use activitystreams_traits::{Activity, Object};
|
||||||
|
|
||||||
use super::{
|
use super::{
|
||||||
kind::UpdateType,
|
kind::UpdateType,
|
||||||
properties::{ActivityExt, ActivityProperties, UpdateProperties},
|
properties::{ActivityProperties, UpdateProperties},
|
||||||
|
ActivityExt,
|
||||||
};
|
};
|
||||||
use object::properties::{ObjectExt, ObjectProperties};
|
use object::{properties::ObjectProperties, ObjectExt};
|
||||||
|
|
||||||
/// Indicates that the actor has updated the object.
|
/// Indicates that the actor has updated the object.
|
||||||
///
|
///
|
||||||
|
|
|
@ -21,9 +21,10 @@ use activitystreams_traits::{Activity, Object};
|
||||||
|
|
||||||
use super::{
|
use super::{
|
||||||
kind::ViewType,
|
kind::ViewType,
|
||||||
properties::{ActivityExt, ActivityProperties, ViewProperties},
|
properties::{ActivityProperties, ViewProperties},
|
||||||
|
ActivityExt,
|
||||||
};
|
};
|
||||||
use object::properties::{ObjectExt, ObjectProperties};
|
use object::{properties::ObjectProperties, ObjectExt};
|
||||||
|
|
||||||
/// Indicates that the actor has viewed the object.
|
/// Indicates that the actor has viewed the object.
|
||||||
#[derive(Clone, Debug, Default, Deserialize, Serialize, Properties)]
|
#[derive(Clone, Debug, Default, Deserialize, Serialize, Properties)]
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
use activitystreams_traits::{Actor, Object};
|
use activitystreams_traits::{Actor, Object};
|
||||||
|
|
||||||
use object::properties::{ObjectExt, ObjectProperties};
|
use object::{properties::ObjectProperties, ObjectExt};
|
||||||
|
|
||||||
pub mod kind;
|
pub mod kind;
|
||||||
use self::kind::*;
|
use self::kind::*;
|
||||||
|
|
|
@ -21,13 +21,23 @@
|
||||||
|
|
||||||
use activitystreams_traits::{Collection, CollectionPage, Object};
|
use activitystreams_traits::{Collection, CollectionPage, Object};
|
||||||
|
|
||||||
use object::properties::{ObjectExt, ObjectProperties};
|
use object::{properties::ObjectProperties, ObjectExt};
|
||||||
|
|
||||||
pub mod kind;
|
pub mod kind;
|
||||||
pub mod properties;
|
pub mod properties;
|
||||||
use self::kind::*;
|
use self::kind::*;
|
||||||
use self::properties::*;
|
use self::properties::*;
|
||||||
|
|
||||||
|
pub trait CollectionExt: Collection {
|
||||||
|
fn props(&self) -> &CollectionProperties;
|
||||||
|
fn props_mut(&mut self) -> &mut CollectionProperties;
|
||||||
|
}
|
||||||
|
|
||||||
|
pub trait CollectionPageExt: CollectionPage {
|
||||||
|
fn props(&self) -> &CollectionPageProperties;
|
||||||
|
fn props_mut(&mut self) -> &mut CollectionPageProperties;
|
||||||
|
}
|
||||||
|
|
||||||
/// The default `Collection` type.
|
/// The default `Collection` type.
|
||||||
#[derive(Clone, Debug, Default, Deserialize, Serialize, Properties)]
|
#[derive(Clone, Debug, Default, Deserialize, Serialize, Properties)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
|
|
|
@ -59,16 +59,6 @@
|
||||||
use activitystreams_traits::{Collection, CollectionPage, Link, Object};
|
use activitystreams_traits::{Collection, CollectionPage, Link, Object};
|
||||||
use serde_json;
|
use serde_json;
|
||||||
|
|
||||||
pub trait CollectionExt {
|
|
||||||
fn props(&self) -> &CollectionProperties;
|
|
||||||
fn props_mut(&mut self) -> &mut CollectionProperties;
|
|
||||||
}
|
|
||||||
|
|
||||||
pub trait CollectionPageExt {
|
|
||||||
fn props(&self) -> &CollectionPageProperties;
|
|
||||||
fn props_mut(&mut self) -> &mut CollectionPageProperties;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// `Collection` objects are a specialization of the base `Object` that serve as a container for
|
/// `Collection` objects are a specialization of the base `Object` that serve as a container for
|
||||||
/// other `Objects` or `Links`.
|
/// other `Objects` or `Links`.
|
||||||
///
|
///
|
||||||
|
|
|
@ -26,6 +26,11 @@ pub mod properties;
|
||||||
use self::kind::*;
|
use self::kind::*;
|
||||||
use self::properties::*;
|
use self::properties::*;
|
||||||
|
|
||||||
|
pub trait LinkExt: Link {
|
||||||
|
fn props(&self) -> &LinkProperties;
|
||||||
|
fn props_mut(&mut self) -> &mut LinkProperties;
|
||||||
|
}
|
||||||
|
|
||||||
/// A specialized Link that represents an @mention.
|
/// A specialized Link that represents an @mention.
|
||||||
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
|
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
|
|
|
@ -53,11 +53,6 @@ use activitystreams_traits::{Error, Link, Object, Result};
|
||||||
use mime;
|
use mime;
|
||||||
use serde_json;
|
use serde_json;
|
||||||
|
|
||||||
pub trait LinkExt {
|
|
||||||
fn props(&self) -> &LinkProperties;
|
|
||||||
fn props_mut(&mut self) -> &mut LinkProperties;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Define all the properties of the Object base type as described by the Activity Streams
|
/// Define all the properties of the Object base type as described by the Activity Streams
|
||||||
/// vocabulary.
|
/// vocabulary.
|
||||||
///
|
///
|
||||||
|
|
|
@ -26,6 +26,11 @@ pub mod properties;
|
||||||
use self::kind::*;
|
use self::kind::*;
|
||||||
use self::properties::*;
|
use self::properties::*;
|
||||||
|
|
||||||
|
pub trait ObjectExt: Object {
|
||||||
|
fn props(&self) -> &ObjectProperties;
|
||||||
|
fn props_mut(&mut self) -> &mut ObjectProperties;
|
||||||
|
}
|
||||||
|
|
||||||
/// Represents any kind of multi-paragraph written work.
|
/// Represents any kind of multi-paragraph written work.
|
||||||
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
|
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
|
|
|
@ -56,11 +56,6 @@ use serde_json;
|
||||||
|
|
||||||
use object::Image;
|
use object::Image;
|
||||||
|
|
||||||
pub trait ObjectExt {
|
|
||||||
fn props(&self) -> &ObjectProperties;
|
|
||||||
fn props_mut(&mut self) -> &mut ObjectProperties;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Alias chrono::DateTime<Utc> for use in derive macros
|
/// Alias chrono::DateTime<Utc> for use in derive macros
|
||||||
pub type UtcTime = DateTime<Utc>;
|
pub type UtcTime = DateTime<Utc>;
|
||||||
|
|
||||||
|
|
|
@ -21,9 +21,7 @@
|
||||||
|
|
||||||
pub use activitystreams_traits::{Activity, IntransitiveActivity};
|
pub use activitystreams_traits::{Activity, IntransitiveActivity};
|
||||||
pub use activitystreams_types::activity::{
|
pub use activitystreams_types::activity::{
|
||||||
kind,
|
kind, properties, AMove, Accept, ActivityExt, Add, Announce, Arrive, Block, Create, Delete,
|
||||||
properties::{self, ActivityExt},
|
Dislike, Flag, Follow, Ignore, Invite, Join, Leave, Like, Listen, Offer, Question, Read,
|
||||||
AMove, Accept, Add, Announce, Arrive, Block, Create, Delete, Dislike, Flag, Follow, Ignore,
|
Reject, Remove, TentativeAccept, TentativeReject, Travel, Undo, Update, View,
|
||||||
Invite, Join, Leave, Like, Listen, Offer, Question, Read, Reject, Remove, TentativeAccept,
|
|
||||||
TentativeReject, Travel, Undo, Update, View,
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -21,7 +21,6 @@
|
||||||
|
|
||||||
pub use activitystreams_traits::{Collection, CollectionPage};
|
pub use activitystreams_traits::{Collection, CollectionPage};
|
||||||
pub use activitystreams_types::collection::{
|
pub use activitystreams_types::collection::{
|
||||||
kind,
|
kind, properties, CollectionExt, CollectionPageExt, OrderedCollection, OrderedCollectionPage,
|
||||||
properties::{self, CollectionExt, CollectionPageExt},
|
UnorderedCollection, UnorderedCollectionPage,
|
||||||
OrderedCollection, OrderedCollectionPage, UnorderedCollection, UnorderedCollectionPage,
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -20,8 +20,4 @@
|
||||||
//! Link traits and types
|
//! Link traits and types
|
||||||
|
|
||||||
pub use activitystreams_traits::Link;
|
pub use activitystreams_traits::Link;
|
||||||
pub use activitystreams_types::link::{
|
pub use activitystreams_types::link::{kind, properties, LinkExt, Mention};
|
||||||
kind,
|
|
||||||
properties::{self, LinkExt},
|
|
||||||
Mention,
|
|
||||||
};
|
|
||||||
|
|
|
@ -21,8 +21,6 @@
|
||||||
|
|
||||||
pub use activitystreams_traits::Object;
|
pub use activitystreams_traits::Object;
|
||||||
pub use activitystreams_types::object::{
|
pub use activitystreams_types::object::{
|
||||||
kind,
|
kind, properties, Article, Audio, Document, Event, Image, Note, ObjectExt, Page, Place,
|
||||||
properties::{self, ObjectExt},
|
Profile, Relationship, Tombstone, Video,
|
||||||
Article, Audio, Document, Event, Image, Note, Page, Place, Profile, Relationship, Tombstone,
|
|
||||||
Video,
|
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue