From 0bedf94797f0605f0a7f83031d452d9830f7dc0f Mon Sep 17 00:00:00 2001 From: asonix Date: Sun, 17 May 2020 12:36:06 -0500 Subject: [PATCH] Add docs from spec --- src/actor.rs | 10 ++++---- src/link.rs | 2 +- src/object.rs | 63 +++++++++++++++++++++++++++++++++++++++------------ 3 files changed, 54 insertions(+), 21 deletions(-) diff --git a/src/actor.rs b/src/actor.rs index dcfa9d3..77e6f54 100644 --- a/src/actor.rs +++ b/src/actor.rs @@ -590,31 +590,31 @@ pub trait ApActorExt: AsApActor { } } -/// The ActivityStreams Application type +/// Describes a software application. /// /// This is just an alias for `Object` because there's no fields inherent to /// Application that aren't already present on an Object. pub type Application = Object; -/// The ActivityStreams Group type +/// Represents a formal or informal collective of Actors. /// /// This is just an alias for `Object` because there's no fields inherent to /// Group that aren't already present on an Object. pub type Group = Object; -/// The ActivityStreams Organization type +/// Represents an organization. /// /// This is just an alias for `Object` because there's no fields inherent to /// Organization that aren't already present on an Object. pub type Organization = Object; -/// The ActivityStreams Person type +/// Represents an individual person. /// /// This is just an alias for `Object` because there's no fields inherent to /// Person that aren't already present on an Object. pub type Person = Object; -/// The ActivityStreams Service type +/// Represents a service of any kind. /// /// This is just an alias for `Object` because there's no fields inherent to /// Service that aren't already present on an Object. diff --git a/src/link.rs b/src/link.rs index 73874d6..da2e780 100644 --- a/src/link.rs +++ b/src/link.rs @@ -464,7 +464,7 @@ pub trait LinkExt: AsLink { } } -/// The ActivityStreams Mention type +/// A specialized Link that represents an @mention. /// /// This is just an alias for `Link` because there's no fields inherent to Mention /// that aren't already present on a Link. diff --git a/src/object.rs b/src/object.rs index a819274..079681a 100644 --- a/src/object.rs +++ b/src/object.rs @@ -4197,49 +4197,49 @@ pub trait TombstoneExt: AsTombstone { } } -/// The ActivityStreams Article type +/// Represents any kind of multi-paragraph written work. /// /// This is just an alias for `Object` because there's no fields inherent to Article /// that aren't already present on an Object. pub type Article = Object; -/// The ActivityStreams Audio type +/// Represents an audio document of any kind. /// /// This is just an alias for `Object` because there's no fields inherent to Audio /// that aren't already present on an Object. pub type Audio = Object; -/// The ActivityStreams Document type +/// Represents a document of any kind. /// /// This is just an alias for `Object` because there's no fields inherent to Document /// that aren't already present on an Object. pub type Document = Object; -/// The ActivityStreams Event type +/// Represents any kind of event. /// /// This is just an alias for `Object` because there's no fields inherent to Event /// that aren't already present on an Object. pub type Event = Object; -/// The ActivityStreams Image type +/// An image document of any kind. /// /// This is just an alias for `Object` because there's no fields inherent to Image /// that aren't already present on an Object. pub type Image = Object; -/// The ActivityStreams Note type +/// Represents a short written work typically less than a single paragraph in length. /// /// This is just an alias for `Object` because there's no fields inherent to Note /// that aren't already present on an Object. pub type Note = Object; -/// The ActivityStreams Page type +/// Represents a Web Page. /// /// This is just an alias for `Object` because there's no fields inherent to Page /// that aren't already present on an Object. pub type Page = Object; -/// The ActivityStreams Video type +/// Represents a video document of any kind. /// /// This is just an alias for `Object` because there's no fields inherent to Video /// that aren't already present on an Object. @@ -4529,7 +4529,24 @@ pub struct ApObject { pub inner: Inner, } -/// Define all the properties of the Location type as described by the Activity Streams vocabulary. +/// Represents a logical or physical location. +/// +/// The Place object is used to represent both physical and logical locations. While numerous +/// existing vocabularies exist for describing locations in a variety of ways, inconsistencies and +/// incompatibilities between those vocabularies make it difficult to achieve appropriate +/// interoperability between implementations. The Place object is included within the Activity +/// vocabulary to provide a minimal, interoperable starting point for describing locations +/// consistently across Activity Streams 2.0 implementations. +/// +/// The Place object is intentionally flexible. It can, for instance, be used to identify a +/// location simply by name, or by longitude and latitude. +/// +/// The Place object can also describe an area around a given point using the radius property, the +/// altitude of the location, and a degree of accuracy. +/// +/// While publishers are not required to use these specific properties and MAY make use of other +/// mechanisms for describing locations, consuming implementations that support the Place object +/// MUST support the use of these properties. #[derive(Clone, Debug, Default, serde::Deserialize, serde::Serialize, TypedBuilder)] #[builder(doc)] pub struct Place { @@ -4596,8 +4613,10 @@ pub struct Place { pub inner: Object, } -/// The object being extendedDefine all the properties of the Profile type as described by the -/// Activity Streams vocabulary. +/// A Profile is a content object that describes another Object, typically used to describe Actor +/// Type objects. +/// +/// The describes property is used to reference the object being described by the profile. #[derive(Clone, Debug, Default, serde::Deserialize, serde::Serialize, TypedBuilder)] #[builder(doc)] pub struct Profile { @@ -4614,8 +4633,20 @@ pub struct Profile { pub inner: Object, } -/// Define all the properties of the Relationship type as described by the Activity Streams -/// vocabulary. +/// Describes a relationship between two individuals. +/// +/// The subject and object properties are used to identify the connected individuals. +/// +/// The Relationship object is used to represent relationships between individuals. It can be used, +/// for instance, to describe that one person is a friend of another, or that one person is a +/// member of a particular organization. The intent of modeling Relationship in this way is to +/// allow descriptions of activities that operate on the relationships in general, and to allow +/// representation of Collections of relationships. +/// +/// For instance, many social systems have a notion of a "friends list". These are the collection +/// of individuals that are directly connected within a person's social graph. Suppose we have a +/// user, Sally, with direct relationships to users Joe and Jane. Sally follows Joe's updates while +/// Sally and Jane have a mutual relationship. #[derive(Clone, Debug, Default, serde::Deserialize, serde::Serialize, TypedBuilder)] #[builder(doc)] pub struct Relationship { @@ -4652,8 +4683,10 @@ pub struct Relationship { pub inner: Object, } -/// Define all the properties of the Tombstone type as described by the Activity Streams -/// vocabulary. +/// A Tombstone represents a content object that has been deleted. +/// +/// It can be used in Collections to signify that there used to be an object at this position, but +/// it has been deleted. #[derive(Clone, Debug, Default, serde::Deserialize, serde::Serialize, TypedBuilder)] #[builder(doc)] pub struct Tombstone {