1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
//! 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 [`Public`] audience appears in multiple equivalent forms
//! - Unknown properties are preserved via flattened extension maps
//!
//! [Activity Streams 2.0 Core]: https://www.w3.org/TR/activitystreams-core/
//! [Activity Vocabulary]: https://www.w3.org/TR/activitystreams-vocabulary/
//! [ActivityPub]: https://www.w3.org/TR/activitypub/
pub use ;
pub use ;
pub use Error;
pub use Link;
pub use ;
pub use ;
pub use Proof;
pub use ;
/// Crate [`Result`] alias with the default error type set to [`Error`].
pub type Result<T, E = Error> = Result;