]> Untitled Git - lemmy.git/blob - crates/apub/src/protocol/objects/tombstone.rs
Federate with Peertube (#2244)
[lemmy.git] / crates / apub / src / protocol / objects / tombstone.rs
1 use crate::protocol::Id;
2 use activitystreams_kinds::object::TombstoneType;
3 use serde::{Deserialize, Serialize};
4 use serde_with::skip_serializing_none;
5 use url::Url;
6
7 #[skip_serializing_none]
8 #[derive(Clone, Debug, Deserialize, Serialize)]
9 #[serde(rename_all = "camelCase")]
10 pub struct Tombstone {
11   pub(crate) id: Url,
12   #[serde(rename = "type")]
13   pub(crate) kind: TombstoneType,
14 }
15
16 impl Tombstone {
17   pub fn new(id: Url) -> Tombstone {
18     Tombstone {
19       id,
20       kind: TombstoneType::Tombstone,
21     }
22   }
23 }
24
25 impl Id for Tombstone {
26   fn id(&self) -> &Url {
27     &self.id
28   }
29 }