2022-05-06 23:53:33 +00:00
|
|
|
use crate::protocol::Id;
|
2021-11-19 17:47:06 +00:00
|
|
|
use activitystreams_kinds::object::TombstoneType;
|
2021-10-27 16:03:07 +00:00
|
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
use serde_with::skip_serializing_none;
|
2021-11-16 00:58:15 +00:00
|
|
|
use url::Url;
|
2021-10-27 16:03:07 +00:00
|
|
|
|
|
|
|
#[skip_serializing_none]
|
|
|
|
#[derive(Clone, Debug, Deserialize, Serialize)]
|
|
|
|
#[serde(rename_all = "camelCase")]
|
|
|
|
pub struct Tombstone {
|
2021-11-16 00:58:15 +00:00
|
|
|
pub(crate) id: Url,
|
2021-10-27 16:03:07 +00:00
|
|
|
#[serde(rename = "type")]
|
2022-05-06 23:53:33 +00:00
|
|
|
pub(crate) kind: TombstoneType,
|
2021-10-27 16:03:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
impl Tombstone {
|
2021-11-16 00:58:15 +00:00
|
|
|
pub fn new(id: Url) -> Tombstone {
|
2021-10-27 16:03:07 +00:00
|
|
|
Tombstone {
|
2021-11-16 00:58:15 +00:00
|
|
|
id,
|
2021-10-27 16:03:07 +00:00
|
|
|
kind: TombstoneType::Tombstone,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2022-05-06 23:53:33 +00:00
|
|
|
|
|
|
|
impl Id for Tombstone {
|
2022-06-02 14:33:41 +00:00
|
|
|
fn object_id(&self) -> &Url {
|
2022-05-06 23:53:33 +00:00
|
|
|
&self.id
|
|
|
|
}
|
|
|
|
}
|