1 use activitystreams::{base::AnyBase, primitives::OneOrMany};
2 use serde::{Deserialize, Serialize};
5 static ref CONTEXT: OneOrMany<AnyBase> =
6 serde_json::from_str(include_str!("../assets/lemmy/context.json")).expect("parse context");
9 #[derive(Serialize, Deserialize)]
10 pub(crate) struct WithContext<T> {
11 #[serde(rename = "@context")]
12 context: OneOrMany<AnyBase>,
17 impl<T> WithContext<T> {
18 pub(crate) fn new(inner: T) -> WithContext<T> {
20 context: CONTEXT.clone(),
24 pub(crate) fn inner(self) -> T {