activitypub-federation-rust/src/protocol/tombstone.rs
Nutomic fa27a0c0b4
Various additions and changes (#147)
* Add methods Object.id(), Object.deleted()

* Rename ActivityHandler to Activity

* comments

* fix

* comment
2025-07-10 10:26:45 +02:00

27 lines
696 B
Rust

//! Tombstone is used to serve deleted objects
use crate::kinds::object::TombstoneType;
use serde::{Deserialize, Serialize};
use url::Url;
/// Represents a local object that was deleted
///
/// <https://www.w3.org/TR/activitystreams-vocabulary/#dfn-tombstone>
#[derive(Clone, Debug, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct Tombstone {
/// Id of the deleted object
pub id: Url,
#[serde(rename = "type")]
pub(crate) kind: TombstoneType,
}
impl Tombstone {
/// Create a new tombstone for the given object id
pub fn new(id: Url) -> Tombstone {
Tombstone {
id,
kind: TombstoneType::Tombstone,
}
}
}