Struct Collection

Source
pub struct Collection {
Show 33 fields pub attributed_to: Property<Or<LinkSubtypes, Remotable<ObjectSubtypes>>>, pub audience: Property<Or<LinkSubtypes, Remotable<ObjectSubtypes>>>, pub start_time: Option<DateTime>, pub replies: Property<Remotable<CollectionSubtypes>>, pub name: LangContainer<Property<String>>, pub in_reply_to: Property<Or<LinkSubtypes, Remotable<ObjectSubtypes>>>, pub last: Option<Box<Or<LinkSubtypes, Remotable<CollectionPageSubtypes>>>>, pub media_type: Option<String>, pub object_type: Property<String>, pub published: Option<DateTime>, pub generator: Property<Or<LinkSubtypes, Remotable<ObjectSubtypes>>>, pub to: Property<Or<LinkSubtypes, Remotable<ObjectSubtypes>>>, pub context: Property<Or<LinkSubtypes, Remotable<ObjectSubtypes>>>, pub tag: Property<Or<LinkSubtypes, Remotable<ObjectSubtypes>>>, pub updated: Option<DateTime>, pub attachment: Property<Or<LinkSubtypes, Remotable<ObjectSubtypes>>>, pub image: Property<Or<LinkSubtypes, Remotable<ImageSubtypes>>>, pub location: Property<Or<LinkSubtypes, Remotable<ObjectSubtypes>>>, pub content: LangContainer<Property<String>>, pub current: Option<Box<Or<LinkSubtypes, Remotable<CollectionPageSubtypes>>>>, pub end_time: Option<DateTime>, pub preview: Property<Or<LinkSubtypes, Remotable<ObjectSubtypes>>>, pub bto: Property<Or<LinkSubtypes, Remotable<ObjectSubtypes>>>, pub url: Property<Or<Url, LinkSubtypes>>, pub total_items: Option<usize>, pub summary: LangContainer<Property<String>>, pub items: Property<Or<LinkSubtypes, Remotable<ObjectSubtypes>>>, pub icon: Property<Or<LinkSubtypes, Remotable<ImageSubtypes>>>, pub bcc: Property<Or<LinkSubtypes, Remotable<ObjectSubtypes>>>, pub cc: Property<Or<LinkSubtypes, Remotable<ObjectSubtypes>>>, pub first: Option<Box<Or<LinkSubtypes, Remotable<CollectionPageSubtypes>>>>, pub id: Option<Url>, pub duration: Option<Duration>,
}
Expand description

https://www.w3.org/ns/activitystreams#Collection

A Collection is a subtype of ObjectSubtypes that represents ordered or unordered sets of ObjectSubtypes or LinkSubtypes instances. Refer to the Activity Streams 2.0 Core specification for a complete description of the CollectionSubtypes type.

Fields§

§attributed_to: Property<Or<LinkSubtypes, Remotable<ObjectSubtypes>>>

https://www.w3.org/ns/activitystreams#attributedTo

Identifies one or more entities to which this object is attributed. The attributed entities might not be Actors. For instance, an object might be attributed to the completion of another activity.

§audience: Property<Or<LinkSubtypes, Remotable<ObjectSubtypes>>>

https://www.w3.org/ns/activitystreams#audience

Identifies one or more entities that represent the total population of entities for which the object can considered to be relevant.

§start_time: Option<DateTime>

https://www.w3.org/ns/activitystreams#startTime

The date and time describing the actual or expected starting time of the object. When used with an Activity object, for instance, the Activity::start_time property specifies the moment the activity began or is scheduled to begin.

§replies: Property<Remotable<CollectionSubtypes>>

https://www.w3.org/ns/activitystreams#replies

Identifies a CollectionSubtypes containing objects considered to be responses to this object.

§name: LangContainer<Property<String>>

https://www.w3.org/ns/activitystreams#name

A simple, human-readable, plain-text name for the object. HTML markup must not be included. The name may be expressed using multiple language-tagged values.

§in_reply_to: Property<Or<LinkSubtypes, Remotable<ObjectSubtypes>>>

https://www.w3.org/ns/activitystreams#inReplyTo

Indicates one or more entities for which this object is considered a response.

§last: Option<Box<Or<LinkSubtypes, Remotable<CollectionPageSubtypes>>>>

https://www.w3.org/ns/activitystreams#last

In a paged Collection, indicates the furthest proceeding page of the collection.

§media_type: Option<String>

https://www.w3.org/ns/activitystreams#mediaType

Identifies the MIME media type of the value of the Object::content property. If not specified, the Object::content property is assumed to contain text/html content.

§object_type: Property<String>

@type

Kind of ObjectSubtypes

§published: Option<DateTime>

https://www.w3.org/ns/activitystreams#published

The date and time at which the object was published

§generator: Property<Or<LinkSubtypes, Remotable<ObjectSubtypes>>>

https://www.w3.org/ns/activitystreams#generator

Identifies the entity (e.g. an application) that generated the object.

§to: Property<Or<LinkSubtypes, Remotable<ObjectSubtypes>>>

https://www.w3.org/ns/activitystreams#to

Identifies an entity considered to be part of the public primary audience of an Object

§context: Property<Or<LinkSubtypes, Remotable<ObjectSubtypes>>>

https://www.w3.org/ns/activitystreams#context

Identifies the context within which the object exists or an activity was performed. The notion of “context” used is intentionally vague. The intended function is to serve as a means of grouping objects and activities that share a common originating context or purpose. An example could be all activities relating to a common project or event.

§tag: Property<Or<LinkSubtypes, Remotable<ObjectSubtypes>>>

https://www.w3.org/ns/activitystreams#tag

One or more “tags” that have been associated with an objects. A tag can be any kind of Object. The key difference between Object::attachment and Object::tag is that the former implies association by inclusion, while the latter implies associated by reference.

§updated: Option<DateTime>

https://www.w3.org/ns/activitystreams#updated

The date and time at which the object was updated

§attachment: Property<Or<LinkSubtypes, Remotable<ObjectSubtypes>>>

https://www.w3.org/ns/activitystreams#attributedTo

Identifies a resource attached or related to an object that potentially requires special handling. The intent is to provide a model that is at least semantically similar to attachments in email.

§image: Property<Or<LinkSubtypes, Remotable<ImageSubtypes>>>

https://www.w3.org/ns/activitystreams#image

Indicates an entity that describes an image for this object. Unlike the icon property, there are no aspect ratio or display size limitations assumed.

§location: Property<Or<LinkSubtypes, Remotable<ObjectSubtypes>>>

https://www.w3.org/ns/activitystreams#location

Indicates one or more physical or logical locations associated with the object.

§content: LangContainer<Property<String>>

https://www.w3.org/ns/activitystreams#content

The content or textual representation of the Object encoded as a JSON string. By default, the value of content is HTML. The Object::media_type property can be used in the object to indicate a different content type. The content may be expressed using multiple language-tagged values.

§current: Option<Box<Or<LinkSubtypes, Remotable<CollectionPageSubtypes>>>>

https://www.w3.org/ns/activitystreams#current

In a paged Collection, indicates the page that contains the most recently updated member items.

§end_time: Option<DateTime>

https://www.w3.org/ns/activitystreams#endTime

The date and time describing the actual or expected ending time of the object. When used with an Activity object, for instance, the Activity::end_time property specifies the moment the activity concluded or is expected to conclude.

§preview: Property<Or<LinkSubtypes, Remotable<ObjectSubtypes>>>

https://www.w3.org/ns/activitystreams#preview

Identifies an entity that provides a preview of this object.

§bto: Property<Or<LinkSubtypes, Remotable<ObjectSubtypes>>>

https://www.w3.org/ns/activitystreams#bto

Identifies an Object that is part of the private primary audience of this Object.

§url: Property<Or<Url, LinkSubtypes>>

https://www.w3.org/ns/activitystreams#url

Identifies one or more links to representations of the object

§total_items: Option<usize>

https://www.w3.org/ns/activitystreams#totalItems

A non-negative integer specifying the total number of objects contained by the logical view of the collection. This number might not reflect the actual number of items serialized within the Collection object instance.

§summary: LangContainer<Property<String>>

https://www.w3.org/ns/activitystreams#summary

A natural language summarization of the object encoded as HTML. Multiple language tagged summaries may be provided.

§items: Property<Or<LinkSubtypes, Remotable<ObjectSubtypes>>>

https://www.w3.org/ns/activitystreams#items

Identifies the items contained in a collection. The items might be ordered or unordered.

§icon: Property<Or<LinkSubtypes, Remotable<ImageSubtypes>>>

https://www.w3.org/ns/activitystreams#icon

Indicates an entity that describes an icon for this object. The image should have an aspect ratio of one (horizontal) to one (vertical) and should be suitable for presentation at a small size.

§bcc: Property<Or<LinkSubtypes, Remotable<ObjectSubtypes>>>

https://www.w3.org/ns/activitystreams#bcc

Identifies one or more Objects that are part of the private secondary audience of this Object.

§cc: Property<Or<LinkSubtypes, Remotable<ObjectSubtypes>>>

https://www.w3.org/ns/activitystreams#cc

Identifies an Object that is part of the public secondary audience of this Object.

§first: Option<Box<Or<LinkSubtypes, Remotable<CollectionPageSubtypes>>>>

https://www.w3.org/ns/activitystreams#first

In a paged Collection, indicates the furthest preceeding page of items in the collection.

§id: Option<Url>

@id

Id of Object

§duration: Option<Duration>

https://www.w3.org/ns/activitystreams#duration

When the object describes a time-bound resource, such as an audio or video, a meeting, etc, the Object::duration property indicates the object’s approximate duration. The value must be expressed as an xsd::Duration as defined by xmlschema11-2, section 3.3.6 (e.g. a period of 5 seconds is represented as PT5S).

Implementations§

Source§

impl Collection

Source

pub fn builder() -> CollectionBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), ())>

Create a builder for building Collection. On the builder, call .attributed_to(...), .audience(...), .start_time(...), .replies(...), .name(...), .in_reply_to(...), .last(...), .media_type(...), .object_type(...), .published(...), .generator(...), .to(...), .context(...), .tag(...), .updated(...), .attachment(...), .image(...), .location(...), .content(...), .current(...), .end_time(...), .preview(...), .bto(...), .url(...), .total_items(...), .summary(...), .items(...), .icon(...), .bcc(...), .cc(...), .first(...), .id(...), .duration(...) to set the values of the fields. Finally, call .build() to create the instance of Collection.

Trait Implementations§

Source§

impl Clone for Collection

Source§

fn clone(&self) -> Collection

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Collection

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Collection

Source§

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl From<Collection> for Object

Source§

fn from(value: Collection) -> Self

Converts to this type from the input type.
Source§

impl From<CollectionPage> for Collection

Source§

fn from(value: CollectionPage) -> Self

Converts to this type from the input type.
Source§

impl From<CollectionSubtypes> for Collection

Source§

fn from(value: CollectionSubtypes) -> Self

Converts to this type from the input type.
Source§

impl From<OrderedCollection> for Collection

Source§

fn from(value: OrderedCollection) -> Self

Converts to this type from the input type.
Source§

impl From<OrderedCollectionPage> for Collection

Source§

fn from(value: OrderedCollectionPage) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for Collection

Source§

fn eq(&self, other: &Collection) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for Collection

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Collection

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> ErasedDestructor for T
where T: 'static,