Fix typo, improve docs in wrapper crate

This commit is contained in:
Riley Trautman 2018-05-14 15:06:01 -05:00
parent 5513a77dd3
commit 9011b35792
13 changed files with 26 additions and 115 deletions

View file

@ -1,7 +1,7 @@
[package]
name = "activitystreams"
description = "Activity Streams in Rust"
version = "0.1.0"
version = "0.1.1"
license = "GPL-3.0"
authors = ["asonix <asonix.dev@gmail.com>"]
repository = "https://github.com/asonix/activitystreams"

View file

@ -1,7 +1,7 @@
[package]
name = "activitystreams-types"
description = "Base types from the Activity Streams spec"
version = "0.1.0"
version = "0.1.1"
license = "GPL-3.0"
authors = ["asonix <asonix.dev@gmail.com>"]
repository = "https://github.com/asonix/activitystreams"

View file

@ -23,13 +23,13 @@ use activitystreams_traits::{Actor, Object};
use object::properties::ObjectProperties;
mod kind;
pub use self::kind::*;
pub mod kind;
use self::kind::*;
/// Describes a software application.
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct Appliation {
pub struct Application {
#[serde(rename = "type")]
kind: ApplicationType,
@ -38,8 +38,8 @@ pub struct Appliation {
pub object_props: ObjectProperties,
}
impl Object for Appliation {}
impl Actor for Appliation {}
impl Object for Application {}
impl Actor for Application {}
/// Represents a formal or informal collective of Actors.
#[derive(Clone, Debug, Default, Deserialize, Serialize)]

View file

@ -28,6 +28,7 @@ pub mod properties;
use self::kind::*;
use self::properties::*;
/// The default `Collection` type.
#[derive(Clone, Debug, Default, Deserialize, Serialize, Properties)]
#[serde(rename_all = "camelCase")]
pub struct UnorderedCollection {

View file

@ -21,9 +21,8 @@
use serde::{de::DeserializeOwned, ser::Serialize};
use activitystreams_traits::{
Activity, Actor, Collection, CollectionPage, IntransitiveActivity, Link, Object,
};
use activitystreams_traits::{Activity, Actor, Collection, CollectionPage, IntransitiveActivity,
Link, Object};
/// A custom type extending Link
///

View file

@ -19,18 +19,9 @@
//! Activity traits and types
/// An Activity is a subtype of `Object` that describes some form of action that may happen, is
/// currently happening, or has already happened.
///
/// The `Activity` type itself serves as an abstract base type for all types of activities. It is
/// important to note that the `Activity` type itself does not carry any specific semantics about
/// the kind of action being taken.
pub use activitystreams_traits::Activity;
/// Instances of `IntransitiveActivity` are a subtype of `Activity` representing intransitive
/// actions.
///
/// The `object` property is therefore inappropriate for these activities.
pub use activitystreams_traits::IntransitiveActivity;
pub use activitystreams_types::activity::*;
pub use activitystreams_traits::{Activity, IntransitiveActivity};
pub use activitystreams_types::activity::{kind, properties, AMove, Accept, Add, Announce, Arrive,
Block, Create, Delete, Dislike, Flag, Follow, Ignore,
Invite, Join, Leave, Like, Listen, Offer, Question,
Read, Reject, Remove, TentativeAccept, TentativeReject,
Travel, Undo, Update, View};

View file

@ -19,25 +19,5 @@
//! Actor traits and types
/// `Actor` types are `Object` types that are capable of performing activities.
///
/// This specification intentionally defines `Actors` in only the most generalized way, stopping
/// short of defining semantically specific properties for each. All Actor objects are
/// specializations of `Object` and inherit all of the core properties common to all Objects.
/// External vocabularies can be used to express additional detail not covered by the Activity
/// Vocabulary. VCard [[vcard-rdf](https://www.w3.org/TR/vcard-rdf/) SHOULD be used to provide
/// additional metadata for `Person`, `Group`, and `Organization` instances.
///
/// While implementations are free to introduce new types of Actors beyond those defined by the
/// Activity Vocabulary, interoperability issues can arise when applications rely too much on
/// extension types that are not recognized by other implementations. Care should be taken to not
/// unduly overlap with or duplicate the existing `Actor` types.
///
/// When an implementation uses an extension type that overlaps with a core vocabulary type, the
/// implementation MUST also specify the core vocabulary type. For instance, some vocabularies
/// (e.g. VCard) define their own types for describing people. An implementation that wishes, for
/// example, to use a `vcard:Individual` as an `Actor` MUST also identify that `Actor` as a
/// `Person`.
pub use activitystreams_traits::Actor;
pub use activitystreams_types::actor::*;
pub use activitystreams_types::actor::{kind, Application, Group, Organization, Person, Service};

View file

@ -19,27 +19,7 @@
//! Collection traits and types
/// A Collection is a subtype of `Object` that represents ordered or unordered sets of `Object` or
/// `Link` instances.
///
/// The items within a Collection can be ordered or unordered. The OrderedCollection type MAY be
/// used to identify a Collection whose items are always ordered. In the JSON serialization, the
/// unordered items of a Collection are represented using the items property while ordered items
/// are represented using the orderedItems property.
///
/// `UnorderedCollection` and `OrderedCollection` types are provided by the `activitystreams-types`
/// crate.
pub use activitystreams_traits::Collection;
/// Used to represent distinct subsets of items from a Collection.
///
/// A `Collection` can contain a large number of items. Often, it becomes impractical for an
/// implementation to serialize every item contained by a `Collection` using the items (or
/// `ordered_items`) property alone. In such cases, the items within a `Collection` can be divided
/// into distinct subsets or "pages". A page is identified using the `CollectionPage` type.
///
/// `UnorderedCollectionPage` and `OrderedCollectionPage` types are provied by the
/// `activitystreams-types` crate.
pub use activitystreams_traits::CollectionPage;
pub use activitystreams_types::collection::*;
pub use activitystreams_traits::{Collection, CollectionPage};
pub use activitystreams_types::collection::{kind, properties, OrderedCollection,
OrderedCollectionPage, UnorderedCollection,
UnorderedCollectionPage};

View file

@ -19,8 +19,4 @@
//! Error traits and types
/// The Error type
pub use activitystreams_traits::Error;
/// An alias for Result<T, Error>
pub use activitystreams_traits::Result;
pub use activitystreams_traits::{Error, Result};

View file

@ -147,7 +147,6 @@ pub mod collection;
mod error;
pub mod link;
pub mod object;
pub mod properties;
pub use self::activity::{Activity, IntransitiveActivity};
pub use self::actor::Actor;
@ -155,4 +154,5 @@ pub use self::collection::{Collection, CollectionPage};
pub use self::error::{Error, Result};
pub use self::link::Link;
pub use self::object::Object;
pub use activitystreams_traits::properties;
pub use activitystreams_types::context;

View file

@ -19,14 +19,5 @@
//! Link traits and types
/// A Link is an indirect, qualified reference to a resource identified by a URL.
///
/// The fundamental model for links is established by
/// [[RFC5988](https://tools.ietf.org/html/rfc5988)]. Many of the properties defined by the
/// Activity Vocabulary allow values that are either instances of Object or Link. When a Link is
/// used, it establishes a qualified relation connecting the subject (the containing object) to the
/// resource identified by the href. Properties of the Link are properties of the reference as
/// opposed to properties of the resource.
pub use activitystreams_traits::Link;
pub use activitystreams_types::link::*;
pub use activitystreams_types::link::{kind, properties, Mention};

View file

@ -19,11 +19,6 @@
//! Object traits and types
/// Describes an object of any kind.
///
/// The Object type serves as the base type for most of the other kinds of objects defined in the
/// Activity Vocabulary, including other Core types such as `Activity`, `IntransitiveActivity`,
/// `Collection` and `OrderedCollection`.
pub use activitystreams_traits::Object;
pub use activitystreams_types::object::*;
pub use activitystreams_types::object::{kind, properties, Article, Audio, Document, Event, Image,
Note, Page, Place, Profile, Relationship, Tombstone, Video};

View file

@ -1,22 +0,0 @@
/*
* This file is part of ActivityStreams.
*
* Copyright © 2018 Riley Trautman
*
* ActivityStreams is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ActivityStreams is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with ActivityStreams. If not, see <http://www.gnu.org/licenses/>.
*/
//! Helpers for translating properties between `serde_json::Value` and concrete types
pub use activitystreams_traits::properties::*;