Skip to main content

dpp/document/lifecycle/v0/
mod.rs

1use bincode::{Decode, DecodeUntrusted, Encode};
2use derive_more::From;
3
4/// What the committed state says about one keep-history document that is no
5/// longer visible to ordinary reads.
6#[derive(Debug, Clone, Copy, Encode, Decode, DecodeUntrusted, From, PartialEq, Eq, Default)]
7#[cfg_attr(
8    feature = "serde-conversion",
9    derive(serde::Serialize, serde::Deserialize),
10    serde(rename_all = "camelCase")
11)]
12pub struct DocumentLifecycleRecordV0 {
13    /// Block time the document was deleted at.
14    pub deleted_at_ms: u64,
15    /// Revision the document carried when it was deleted.
16    pub latest_revision: u64,
17    /// Number of revisions the history retained when the document was deleted.
18    ///
19    /// Together with `latest_revision` this says whether the retained history
20    /// was contiguous: an erase removes the newest revisions first, so what
21    /// survives afterwards is a prefix of what was retained here, and a
22    /// by-revision read stays meaningful exactly when the two are equal.
23    pub revision_count: u64,
24    /// Block time an authorized erasure started at, or zero while none has.
25    pub erasing_started_at_ms: u64,
26    /// Timestamp component of the newest revision retained when the erasure
27    /// started, or zero while none has.
28    pub erasing_from_time_ms: u64,
29    /// History sequence of the newest revision retained when the erasure
30    /// started, or zero while none has.
31    pub erasing_from_revision: u64,
32}