pub struct Tombstone {
pub deleted_at_unix_ms: i64,
pub purge_after_unix_ms: Option<i64>,
pub principal_id: String,
pub reason: TombstoneReason,
pub repo: Option<Repo>,
pub note: String,
}Expand description
A dated tombstone: the record beside a repository whose catalog row is gone and whose bytes are not.
Written by ServerStores::soft_delete and by a failed
ServerStores::purge_repo, read by ServerStores::refuse_stale_store
(which is what makes the NAME unusable), by
[ServerStores::undelete] and by the sweep.
§Why the catalog row is copied in here
undelete has to restore what was there — the hash kind above all. A
repository recreated --hash sha256 over a sha1 store serves sha1 refs to a
client that asked for sha256 and answers fatal: protocol error; that is
the 2026-08-30 resurrection this closed, and an undelete that guessed the
defaults would re-open it from the other side. The store’s own
OBJECT_FORMAT marker is the second opinion, and
ServerStores::create_repo’s adopt path checks them against each other.
§It is JSON, and it is read leniently
An earlier build wrote a free-text note here. A file that does not parse as JSON is
therefore read as one of those: reason ReclaimFailed, no deadline, the
text kept as the note. An old appliance’s tombstone keeps working, and a
new one is never mistaken for a soft delete it was not.
Fields§
§deleted_at_unix_ms: i64When the delete was asked for.
purge_after_unix_ms: Option<i64>When a sweep may reclaim the bytes.
None means never on its own: a failed reclaim is owed to an
operator, not scheduled, and a sweep that purged it would be doing the
thing that already failed, unattended.
principal_id: StringWho asked. Empty when a local CLI did it with no principal.
reason: TombstoneReasonHeld, or owed.
repo: Option<Repo>The catalog row as it was, so undelete restores it rather than a
default. None on a tombstone written before this existed.
note: StringA sentence a human reads.
Implementations§
Source§impl Tombstone
impl Tombstone
Sourcepub fn parse(text: &str) -> Tombstone
pub fn parse(text: &str) -> Tombstone
Read one, leniently. See the type docs on the free-text form.
Sourcepub fn is_expired_at(&self, now_unix_ms: i64) -> bool
pub fn is_expired_at(&self, now_unix_ms: i64) -> bool
Is the retention window over at now?
A tombstone with no deadline is never expired, whatever now is.
Sourcepub fn seconds_left(&self, now_unix_ms: i64) -> Option<i64>
pub fn seconds_left(&self, now_unix_ms: i64) -> Option<i64>
How long is left, in whole seconds, or None when there is no deadline.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Tombstone
impl<'de> Deserialize<'de> for Tombstone
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Tombstone
impl StructuralPartialEq for Tombstone
Auto Trait Implementations§
impl Freeze for Tombstone
impl RefUnwindSafe for Tombstone
impl Send for Tombstone
impl Sync for Tombstone
impl Unpin for Tombstone
impl UnsafeUnpin for Tombstone
impl UnwindSafe for Tombstone
Blanket Implementations§
impl<T> Allocation for T
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request