pub struct TombstoneJournal { /* private fields */ }Expand description
Persistent append-only tombstone journal backed by a JSONL file.
Implementations§
Source§impl TombstoneJournal
impl TombstoneJournal
Sourcepub fn append(&self, entry: &TombstoneEntry) -> Result<()>
pub fn append(&self, entry: &TombstoneEntry) -> Result<()>
Append a tombstone entry to the journal.
Uses append mode – atomic for lines shorter than PIPE_BUF (4096 bytes) on POSIX systems when the journal is on a local filesystem.
Sourcepub fn read_all(&self) -> Result<Vec<TombstoneEntry>>
pub fn read_all(&self) -> Result<Vec<TombstoneEntry>>
Read all valid entries from the journal, skipping malformed lines.
Sourcepub fn compact(&self, max_age_secs: i64) -> Result<u64>
pub fn compact(&self, max_age_secs: i64) -> Result<u64>
Remove entries older than max_age_secs and atomically replace the journal.
Also removes entries whose path has been re-created (nullification): if a Create event with a later timestamp exists for the same path, the tombstone is stale.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for TombstoneJournal
impl RefUnwindSafe for TombstoneJournal
impl Send for TombstoneJournal
impl Sync for TombstoneJournal
impl Unpin for TombstoneJournal
impl UnsafeUnpin for TombstoneJournal
impl UnwindSafe for TombstoneJournal
Blanket Implementations§
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
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more