]> Untitled Git - lemmy.git/blob - crates/apub/src/protocol/collections/empty_outbox.rs
Use doku(skip) for opentelemetry_url config value (ref #2085) (#2091)
[lemmy.git] / crates / apub / src / protocol / collections / empty_outbox.rs
1 use activitystreams_kinds::collection::OrderedCollectionType;
2 use lemmy_utils::LemmyError;
3 use serde::{Deserialize, Serialize};
4 use url::Url;
5
6 /// Empty placeholder outbox used for Person, Instance, which dont implement a proper outbox yet.
7 #[derive(Clone, Debug, Deserialize, Serialize)]
8 #[serde(rename_all = "camelCase")]
9 pub(crate) struct EmptyOutbox {
10   r#type: OrderedCollectionType,
11   id: Url,
12   ordered_items: Vec<()>,
13   total_items: i32,
14 }
15
16 impl EmptyOutbox {
17   pub(crate) async fn new(outbox_id: Url) -> Result<EmptyOutbox, LemmyError> {
18     Ok(EmptyOutbox {
19       r#type: OrderedCollectionType::OrderedCollection,
20       id: outbox_id,
21       ordered_items: vec![],
22       total_items: 0,
23     })
24   }
25 }