Skip to main content

Crate ojak_vocab

Crate ojak_vocab 

Source
Expand description

The Activity Vocabulary, for Ojak.

Every ActivityStreams type and the extensions the fediverse uses, from Fedify’s vocabulary schemas and Ojak’s own additions to them (see schemas/ and extensions/), generated into generated and exported here: ojak_vocab::Note, ojak_vocab::Follow, ojak_vocab::AnyObject.

A document is read by what it means: read normalises it over the contexts Ojak ships and reads it into a type, and read_reporting says what the type did not keep. write() writes a value in Ojak’s spelling, under Ojak’s context.

This crate models protocol data only. It does not fetch, store, deliver, or decide anything.

Re-exports§

pub use loss::Loss;
pub use generated::*;

Modules§

generated
Vocabulary types generated from Fedify’s schemas.
json
Reading and writing the generated vocabulary types.
loss
What a typed value did not keep of the document it was read from.
meaning
What a post or a reaction means, where the fediverse says it more than one way.

Structs§

Read
A document read into a vocabulary type.
Registry
The contexts available to a processing run.

Enums§

ReadError
Why a document could not be read.
Reference
A value that is either an object’s IRI or the object itself.

Constants§

ACTIVITYSTREAMS_CONTEXT
The canonical Activity Streams JSON-LD context URL.
ACTIVITYSTREAMS_PUBLIC
The special collection addressing every actor (public posts).

Functions§

is_public_collection
Whether iri names the public collection, in any of the spellings compaction leaves it in: in full, as as:Public, or as Public. Mastodon’s ActivityPub::TagManager#public_collection?.
read
Read a document from another server into a vocabulary type.
read_reporting
read, and say what the value did not keep: see Read::lost.
write
Write a vocabulary value as a document: in Ojak’s spelling, under Ojak’s context.
write_with_context
Write a vocabulary value as a document under context rather than Ojak’s: the plain ActivityStreams context, say, which is what Mastodon writes its activities under. @context comes first, wherever a map that keeps its keys in order writes them.

Type Aliases§

Iri
An absolute ActivityPub/ActivityStreams identifier.