pub struct DurableTraceJournal { /* private fields */ }Expand description
Durable, per-workspace persistence layer for execution traces.
Implementations§
Source§impl DurableTraceJournal
impl DurableTraceJournal
Sourcepub fn open(
root: &Path,
config: JournalConfig,
) -> Result<Self, TraceJournalError>
pub fn open( root: &Path, config: JournalConfig, ) -> Result<Self, TraceJournalError>
Opens (or creates) a durable trace journal rooted at root, using the
real system clock for segment rollover/retention timing.
§Errors
Sourcepub fn open_with_clock(
root: &Path,
config: JournalConfig,
clock: Arc<dyn BrokerClock>,
) -> Result<Self, TraceJournalError>
pub fn open_with_clock( root: &Path, config: JournalConfig, clock: Arc<dyn BrokerClock>, ) -> Result<Self, TraceJournalError>
As Self::open, with an injectable clock for deterministic tests.
§Errors
Returns TraceJournalError::Journal when the journal cannot be
opened, including when a completed (non-final) on-disk record is
corrupt (spec 066 FR-009: fail loudly rather than silently discard).
Returns TraceJournalError::Deserialize when a durably-recorded
trace record cannot be parsed back during the open-time recovery scan.
Sourcepub fn recovery_report(&self) -> &TraceRecoveryReport
pub fn recovery_report(&self) -> &TraceRecoveryReport
Deterministic evidence of what survived recovery when this journal was opened (FR-003).
Sourcepub fn record(
&mut self,
public: &PublicTraceEntry,
private: Option<&PrivateTraceEntry>,
) -> Result<String, TraceJournalError>
pub fn record( &mut self, public: &PublicTraceEntry, private: Option<&PrivateTraceEntry>, ) -> Result<String, TraceJournalError>
Durably appends one trace record, fsync-committed before returning
(FR-001). Returns the journal cursor for the appended record.
§Errors
Returns TraceJournalError when the durable write fails.
Sourcepub fn prune(&mut self) -> Result<TracePrunedEvidence, TraceJournalError>
pub fn prune(&mut self) -> Result<TracePrunedEvidence, TraceJournalError>
Reclaims retained trace history past the configured age/size bounds, deterministic oldest segment first, never touching the active (currently-being-written) segment (FR-005).
§Errors
Returns TraceJournalError when a segment cannot be removed.
Auto Trait Implementations§
impl !Freeze for DurableTraceJournal
impl !RefUnwindSafe for DurableTraceJournal
impl !UnwindSafe for DurableTraceJournal
impl Send for DurableTraceJournal
impl Sync for DurableTraceJournal
impl Unpin for DurableTraceJournal
impl UnsafeUnpin for DurableTraceJournal
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
Source§impl<T> GetSetFdFlags for T
impl<T> GetSetFdFlags for T
Source§fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
self file descriptor.Source§fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
Source§fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: Sized + AsFilelike,
fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: Sized + AsFilelike,
self file descriptor. Read moreSource§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> 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> ⓘ
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> ⓘ
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