pub struct Object<'a> {
Show 36 fields pub context: Option<ObjectsOrLinks<'a>>, pub type_: Option<Links<'a>>, pub id: Option<Cow<'a, str>>, pub attributed_to: Option<ObjectsOrLinks<'a>>, pub name: Option<Cow<'a, str>>, pub name_map: Option<HashMap<Cow<'a, str>, Cow<'a, str>>>, pub summary: Option<Cow<'a, str>>, pub summary_map: Option<HashMap<Cow<'a, str>, Cow<'a, str>>>, pub audience: Option<ObjectsOrLinks<'a>>, pub content: Option<Cow<'a, str>>, pub content_map: Option<HashMap<Cow<'a, str>, Cow<'a, str>>>, pub to: Option<ObjectsOrLinks<'a>>, pub bto: Option<ObjectsOrLinks<'a>>, pub cc: Option<ObjectsOrLinks<'a>>, pub bcc: Option<ObjectsOrLinks<'a>>, pub in_reply_to: Option<ObjectsOrLinks<'a>>, pub published: Option<Date>, pub actor: Option<ObjectsOrLinks<'a>>, pub object: Option<ObjectOrLink<'a>>, pub target: Option<ObjectOrLink<'a>>, pub total_items: Option<u32>, pub current: Option<ObjectOrLink<'a>>, pub first: Option<ObjectOrLink<'a>>, pub last: Option<ObjectOrLink<'a>>, pub ordered_items: Option<ObjectsOrLinks<'a>>, pub prev: Option<ObjectOrLink<'a>>, pub next: Option<ObjectOrLink<'a>>, pub part_of: Option<ObjectOrLink<'a>>, pub inbox: Option<Cow<'a, str>>, pub outbox: Option<Cow<'a, str>>, pub following: Option<Cow<'a, str>>, pub followers: Option<Cow<'a, str>>, pub liked: Option<Cow<'a, str>>, pub streams: Option<Links<'a>>, pub preferred_username: Option<Cow<'a, str>>, pub endpoints: Option<ApEndpoints<'a>>,
}
Expand description

A general struct describing any* Activity Streams 2.0 object. See also: Activity Vocabulary.

This is simply a strongly typed version of the JSON used to describe the objects specified in the standard. Extensions are not supported by design.

Most of the fields contain ObjectsOrLinks as the standard is quite loose with specifying what fits in which property: almost all of them can have none, one, or many values, and those values can simply refer to an object by id (“links”) or be the entire object, hence the very nested and recursive structure of this object. In practice, these objects aren’t that sprawling, mostly recursing one or two levels deep.

All the properties are converted from snake_case to camelCase. See the 4. Properties chapter of the Activity Vocabulary for descriptions of all the fields.

* Currently not all properties of Activity Streams 2.0 objects are included, as this isn’t a full implementation.

Fields

context: Option<ObjectsOrLinks<'a>>

Serializes and deserializes to and from “@context”. Renamed for Rust variable naming rules.

type_: Option<Links<'a>>

Serializes and deserializes to and from “type”. Renamed for Rust variable naming rules.

id: Option<Cow<'a, str>>

This is a Some in almost all cases: only anonymous objects, such as those submitted to the server during a C2S interaction where the Object hasn’t yet been properly finalized.

attributed_to: Option<ObjectsOrLinks<'a>>name: Option<Cow<'a, str>>name_map: Option<HashMap<Cow<'a, str>, Cow<'a, str>>>summary: Option<Cow<'a, str>>summary_map: Option<HashMap<Cow<'a, str>, Cow<'a, str>>>audience: Option<ObjectsOrLinks<'a>>content: Option<Cow<'a, str>>content_map: Option<HashMap<Cow<'a, str>, Cow<'a, str>>>to: Option<ObjectsOrLinks<'a>>bto: Option<ObjectsOrLinks<'a>>cc: Option<ObjectsOrLinks<'a>>bcc: Option<ObjectsOrLinks<'a>>in_reply_to: Option<ObjectsOrLinks<'a>>published: Option<Date>actor: Option<ObjectsOrLinks<'a>>object: Option<ObjectOrLink<'a>>target: Option<ObjectOrLink<'a>>total_items: Option<u32>current: Option<ObjectOrLink<'a>>first: Option<ObjectOrLink<'a>>last: Option<ObjectOrLink<'a>>ordered_items: Option<ObjectsOrLinks<'a>>prev: Option<ObjectOrLink<'a>>next: Option<ObjectOrLink<'a>>part_of: Option<ObjectOrLink<'a>>inbox: Option<Cow<'a, str>>outbox: Option<Cow<'a, str>>following: Option<Cow<'a, str>>followers: Option<Cow<'a, str>>liked: Option<Cow<'a, str>>streams: Option<Links<'a>>preferred_username: Option<Cow<'a, str>>endpoints: Option<ApEndpoints<'a>>

Implementations

Returns true if the type_ field of the object is or contains the given link. Generally these are from the Activity Streams spec, so they’re not fully qualified urls, e.g. "Note" or "Follow".

Returns true if the type of this object is one of the Actor types. See 3.2 Actor Types in the Activity Vocabulary.

Recursively calls ObjectOrLink::compact for all the ObjectOrLink and ObjectsOrLinks properties in this object.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
Deserialize this value from the given Serde deserializer. Read more
Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

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

Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more