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§
- Collection
Page Properties - The
CollectionPagetype extends from the baseCollectiontype and inherits all of it’s properties. - Collection
Properties Collectionobjects are a specialization of the baseObjectthat serve as a container for otherObjectsorLinks.- Ordered
Collection Page Properties - The OrderedCollectionPage type MAY be used to identify a page whose items are strictly ordered.