Expand description
Activity Streams 2.0 data model and vocabulary.
This crate provides pure data types (no I/O, no networking) for the W3C Activity Streams 2.0 Core and Activity Vocabulary specifications, as used by the ActivityPub protocol.
§Design
The types are designed for idiomatic serde (de)serialization with
tolerant handling of the JSON-LD variants emitted by real-world Fediverse
implementations such as Mastodon, Pleroma, Lemmy and Misskey.
Core AS 2.0 types (Object, Link, [Activity], [Collection]) are
concrete structs with every specification-defined property represented as
Option<T> or OneOrMany<T>. Concrete vocabulary types that add no new
properties (Note, Article, Create, …) share the core structs and are
discriminated by string type constants (kind), while types that add
new properties (Question, Place, Tombstone) are provided as
dedicated structs that flatten the core object.
§Interoperability
Real Fediverse JSON-LD is inconsistent and requires tolerance:
- Array-typed properties may appear as a single value (handled by
OneOrMany<T>) - Object properties may be inlined or appear as plain URL strings (handled
by
UrlOr<T>) - The
Publicaudience appears in multiple equivalent forms - Unknown properties are preserved via flattened extension maps
Modules§
- kind
- String type constants for every name defined in the Activity Streams 2.0
vocabulary and the
ActivityPubextension types.
Structs§
- Context
- The value of a JSON-LD
@contextproperty. - Endpoints
ActivityPub§4.1endpointsblock.- Link
- An Activity Streams 2.0
Link. - Multikey
- FEP-521a
Multikeyblock. - Object
- The universal Activity Streams 2.0 object container.
- OneOr
Many - A value that may serialize as either a single
Tor as an ordered array ofT. - Proof
- FEP-8b32 / W3C Data Integrity Proof block.
- Public
- The
Publicpseudo-actor used for public audience targeting inActivityPub. - Public
Key - W3C Security v1
publicKeyblock. - With
Context - Wraps any Activity Streams payload with a JSON-LD
@context.
Enums§
- Context
Entry - A single entry in the
@contextarray. - Error
- Errors that can arise when parsing or constructing Activity Streams values.
- UrlOr
- A value that may appear inlined as
Tor as a bare URL reference.
Traits§
- HasId
- Types with an optional
idURL, enabling uniform reference resolution.
Type Aliases§
- Assertion
Method - A reference to a verification method, either as a bare URL or an
inlined
Multikeydocument. - Language
Map - A language map keyed by BCP-47 language tag, as used by
contentMap,summaryMap, andnameMap. - Object
Ref - A reference-valued property that may appear as a bare URL or as an
inlined
Object. - Result
- Crate
Resultalias with the default error type set toError.