Skip to main content

Object

Struct Object 

Source
pub struct Object {
Show 39 fields pub id: Option<Iri>, pub attachments: Vec<LinkOrObjectOrPropertyValue>, pub attributions: Vec<AnyActor>, pub audiences: Vec<AnyObject>, pub content: Text, pub contexts: Vec<LinkOrObject>, pub name: Text, pub end_time: Option<String>, pub generators: Vec<LinkOrObject>, pub icons: Vec<Reference<Image>>, pub images: Vec<Reference<Image>>, pub reply_targets: Vec<LinkOrObject>, pub locations: Vec<LinkOrObject>, pub previews: Vec<LinkOrObject>, pub published: Option<String>, pub replies: Option<AnyCollection>, pub shares: Option<AnyCollection>, pub likes: Option<AnyCollection>, pub emoji_reactions: Option<AnyCollection>, pub start_time: Option<String>, pub summary: Text, pub tags: Vec<LinkOrObject>, pub updated: Option<String>, pub urls: Vec<LinkOrIri>, pub tos: Vec<AnyObject>, pub btos: Vec<AnyObject>, pub ccs: Vec<AnyObject>, pub bccs: Vec<AnyObject>, pub media_type: Option<String>, pub duration: Option<String>, pub sensitive: Option<bool>, pub source: Option<Box<Source>>, pub proofs: Vec<Reference<DataIntegrityProof>>, pub interaction_policy: Option<Box<InteractionPolicy>>, pub approved_by: Option<Iri>, pub like_authorization: Option<Reference<LikeAuthorization>>, pub reply_authorization: Option<Reference<ReplyAuthorization>>, pub announce_authorization: Option<Reference<AnnounceAuthorization>>, pub translations: Vec<Translation>,
}
Expand description

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 {@link Activity}, {@link IntransitiveActivity}, {@link Collection} and {@link OrderedCollection}.

The type https://www.w3.org/ns/activitystreams#Object.

Fields§

§id: Option<Iri>

The IRI that identifies this object.

§attachments: Vec<LinkOrObjectOrPropertyValue>

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.

§attributions: Vec<AnyActor>

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.

§audiences: Vec<AnyObject>

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

§content: Text

The content or textual representation of the Object encoded as a JSON string. By default, the value of content is HTML. The mediaType property can be used in the object to indicate a different content type.

§contexts: Vec<LinkOrObject>

Identifies the context within which the object exists or an activity was performed.

§name: Text

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.

§end_time: Option<String>

The date and time describing the actual or expected ending time of the object. When used with an {@link Activity} object, for instance, the `endTime`` property specifies the moment the activity concluded or is expected to conclude.

§generators: Vec<LinkOrObject>

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

§icons: Vec<Reference<Image>>

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.

§images: Vec<Reference<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.

§reply_targets: Vec<LinkOrObject>

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

§locations: Vec<LinkOrObject>

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

§previews: Vec<LinkOrObject>

Identifies an entity that provides a preview of this object.

§published: Option<String>

The date and time at which the object was published.

§replies: Option<AnyCollection>

Identifies a {@link Collection} containing objects considered to be responses to this object.

§shares: Option<AnyCollection>

Every object may have a shares collection. This is a list of all {@link Announce} activities with this object as the object property, added as a side effect. The shares collection must be either an {@link OrderedCollection} or a {@link Collection} and may be filtered on privileges of an authenticated user or as appropriate when no authentication is given.

§likes: Option<AnyCollection>

Every object may have a likes collection. This is a list of all {@link Like} activities with this object as the object property, added as a side effect. The likes collection must be either an {@link OrderedCollection} or a {@link Collection} and may be filtered on privileges of an authenticated user or as appropriate when no authentication is given.

§emoji_reactions: Option<AnyCollection>

Identifies a {@link Collection} containing objects considered to be emoji reactions to this object.

§start_time: Option<String>

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

§summary: Text

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

§tags: Vec<LinkOrObject>

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

§updated: Option<String>

The date and time at which the object was updated.

§urls: Vec<LinkOrIri>

Identifies one or more links to representations of the object.

§tos: Vec<AnyObject>

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

§btos: Vec<AnyObject>

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

§ccs: Vec<AnyObject>

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

§bccs: Vec<AnyObject>

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

§media_type: Option<String>

When used on an {@link Object}, identifies the MIME media type of the value of the content property. If not specified, the content property is assumed to contain text/html content.

§duration: Option<String>

When the object describes a time-bound resource, such as an audio or video, a meeting, etc, the duration property indicates the object’s approximate duration. The value MUST be expressed as an xsd:duration as defined by W3C XML Schema Definition Language (XSD) 1.1 Part 2: DataTypes, section 3.3.6 (e.g. a period of 5 seconds is represented as PT5S).

§sensitive: Option<bool>

Whether it contains any sensitive contents.

§source: Option<Box<Source>>

The source property is intended to convey some sort of source from which the content markup was derived, as a form of provenance, or to support future editing by clients. In general, clients do the conversion from source to content, not the other way around.

§proofs: Vec<Reference<DataIntegrityProof>>

A cryptographic proof that can be used to verify the integrity of an object.

§interaction_policy: Option<Box<InteractionPolicy>>

The interaction policy for this object, specifying who can like, reply to, announce, or quote it. Contains sub-policies (canLike, canReply, canAnnounce, canQuote) each defining automaticApproval and manualApproval lists.

§approved_by: Option<Iri>

A URI referencing an authorization object that proves this interaction was approved by the target post’s author.

§like_authorization: Option<Reference<LikeAuthorization>>

A {@link LikeAuthorization} object that proves this like interaction was approved by the target post’s author.

§reply_authorization: Option<Reference<ReplyAuthorization>>

A {@link ReplyAuthorization} object that proves this reply was approved by the target post’s author.

§announce_authorization: Option<Reference<AnnounceAuthorization>>

An {@link AnnounceAuthorization} object that proves this announce (boost) was approved by the target post’s author.

§translations: Vec<Translation>

Translation metadata for the language versions in this object’s content, name, or summary maps, as defined by the draft FEP-22cd. Each entry describes one translated language; directly authored languages have no entry. The entries share this object’s identity, replies, and reactions. Translator credit grants no authority to update the object.

Implementations§

Source§

impl Object

Source

pub const TYPE_IRI: &'static str = "https://www.w3.org/ns/activitystreams#Object"

The type’s IRI.

Source

pub const TYPE: &'static str = "Object"

The type’s type in a normalised document.

Trait Implementations§

Source§

impl Clone for Object

Source§

fn clone(&self) -> Object

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Object

Source§

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

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

impl Default for Object

Source§

fn default() -> Object

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Object

Source§

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

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

impl FromJson for Object

Source§

fn from_json(value: &Value) -> Result<Self, JsonError>

Read value. Read more
Source§

impl PartialEq for Object

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl Serialize for Object

Source§

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

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

impl StructuralPartialEq for Object

Source§

impl ToJson for Object

Source§

fn to_json(&self) -> Value

Write self.
Source§

impl Typed for Object

Source§

const TYPE: &'static str = "Object"

The type’s type in a normalised document, such as Create.

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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> Same for T

Source§

type Output = T

Should always be Self
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.