lemmy/crates/apub/src/protocol/objects/tombstone.rs

23 lines
478 B
Rust
Raw Normal View History

use activitystreams::object::kind::TombstoneType;
use serde::{Deserialize, Serialize};
use serde_with::skip_serializing_none;
2021-11-16 00:58:15 +00:00
use url::Url;
#[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,
#[serde(rename = "type")]
kind: TombstoneType,
}
impl Tombstone {
2021-11-16 00:58:15 +00:00
pub fn new(id: Url) -> Tombstone {
Tombstone {
2021-11-16 00:58:15 +00:00
id,
kind: TombstoneType::Tombstone,
}
}
}