Module properties

Module properties 

Source
Expand description

Namespace for properties of standard collection types

To use these properties in your own types, you can flatten them into your struct with serde:

use activitystreams_traits::{Collection, Object};
use activitystreams_types::{
  collection::properties::CollectionProperties,
  object::properties::ObjectProperties,
};
use serde_derive::{Deserialize, Serialize};

#[derive(Clone, Debug, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct MyCollection {
    #[serde(rename = "type")]
    pub kind: String,

    /// Define a require property for the MyCollection type
    pub my_property: String,

    #[serde(flatten)]
    pub object_properties: ObjectProperties,

    #[serde(flatten)]
    pub collection_properties: CollectionProperties,
}

impl Object for MyCollection {}
impl Collection for MyCollection {}

Structs§

CollectionPageProperties
The CollectionPage type extends from the base Collection type and inherits all of it’s properties.
CollectionProperties
Collection objects are a specialization of the base Object that serve as a container for other Objects or Links.
OrderedCollectionPageProperties
The OrderedCollectionPage type MAY be used to identify a page whose items are strictly ordered.