1 use once_cell::sync::Lazy;
2 use serde::{Deserialize, Serialize};
4 static CONTEXT: Lazy<Vec<serde_json::Value>> = Lazy::new(|| {
5 serde_json::from_str(include_str!("../assets/lemmy/context.json")).expect("parse context")
8 #[derive(Serialize, Deserialize, Debug)]
9 pub(crate) struct WithContext<T> {
10 #[serde(rename = "@context")]
11 context: Vec<serde_json::Value>,
16 impl<T> WithContext<T> {
17 pub(crate) fn new(inner: T) -> WithContext<T> {
19 context: (*CONTEXT).clone(),
23 pub(crate) fn inner(self) -> T {