upub/apb
2024-04-06 18:24:10 +02:00
..
src fix(apb): proper feature gating, dict->unstructured 2024-04-06 18:04:14 +02:00
Cargo.lock feat: separated apb types into crate, reworked 2024-04-06 16:56:13 +02:00
Cargo.toml chore: crate metadata, MIT license 2024-04-06 18:17:07 +02:00
README.md docs: added readme 2024-04-06 18:24:10 +02:00

apb

traits and types for implementing ActivityPub

apb implements all ActivityStreams types as traits, so that implementing structs don't need to hold all possible fields, but only implement getters for relevant ones

apb also provides a Node enum, which can be Empty, Link, Object or Array

if the unstructured feature is enabled, all traits are implemented for serde_json::Value, so that it's possible to manipulate free-form json maps as valid AP objects

if the orm feature is enabled, enum types are also database-friendly with sea-orm

if the fetch feature is enabled (together with unstructured), Nodes expose a async fn fetch(&mut self) -> reqwest::Result<&mut Self> to dereference remote nodes

why

upub uses these types to implement its federation, but I wanted to modularize apb types. this crate is still work in progress and favors upub's needs, get in touch if you'd like to help or tune apb to your project!