feder_core/lib.rs
1// Feder: A portable ActivityPub core for many runtimes.
2// Copyright (C) 2026 Feder contributors
3//
4// This program is free software: you can redistribute it and/or modify
5// it under the terms of the GNU Affero General Public License as published by
6// the Free Software Foundation, version 3.
7//
8// This program is distributed in the hope that it will be useful,
9// but WITHOUT ANY WARRANTY; without even the implied warranty of
10// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11// GNU Affero General Public License for more details.
12//
13// You should have received a copy of the GNU Affero General Public License
14// along with this program. If not, see <https://www.gnu.org/licenses/>.
15
16//! Portable ActivityPub protocol decisions and capability traits for Feder.
17//!
18//! This crate is independent of networking, persistence, operating-system
19//! services, and async executors. Runtimes supply stored facts and execute the
20//! transient outcomes returned by its protocol functions.
21#![no_std]
22
23extern crate alloc;
24
25pub use feder_vocab as vocab;
26use feder_vocab::{Actor, Iri};
27
28pub mod follow;
29#[cfg(feature = "http-signatures")]
30pub mod key;
31pub mod note;
32pub mod storage;
33pub mod undo;
34
35pub trait ActorDispatcher {
36 type Error;
37
38 fn get_actor(&self, identifier: &str) -> Result<Option<Actor>, Self::Error>;
39
40 fn get_actor_by_id(&self, actor_id: &Iri) -> Result<Option<Actor>, Self::Error>;
41}