Skip to main content

CheckpointPagedLog

Struct CheckpointPagedLog 

Source
pub struct CheckpointPagedLog<R, D> { /* private fields */ }
Expand description

Optional atomic journal replacement over three exclusive device values. Root data is unused; its two metadata slots select one complete page bank. Bank identities bind each reuse to a distinct monotone root epoch. Neither extraction nor destruction flushes pending records. A failed I/O fences this owner; reopen all devices to discover its actual durable state. Destruction drops both banks before the root, following device destructors.

Implementations§

Source§

impl<R: PageDevice, D: PageDevice> CheckpointPagedLog<R, D>

Source

pub fn open(root: R, banks: [D; 2]) -> Result<Self, LinkError>

Source

pub fn with_max_pages( root: R, banks: [D; 2], max_pages: u64, ) -> Result<Self, LinkError>

Source

pub fn epoch(&self) -> u64

Source

pub fn into_devices(self) -> (R, [D; 2])

Source§

impl<R: PageDevice, D: PageDevice> CheckpointPagedLog<R, D>

Source

pub fn inspect( root: &mut R, banks: &mut [D; 2], max_pages: u64, ) -> Result<Vec<String>, LinkError>

Read the complete selected prefix without initialization, truncation, identity allocation or repair completion. Devices remain borrowed. Checked mirror reads may stage volatile repairs: discard those wrappers if higher-level semantic validation fails. Inspecting does not close any device or change the existing opening constructors’ recovery behavior.

Trait Implementations§

Source§

impl<R: PageDevice, D: PageDevice> ReplaceableTransitionLogStore for CheckpointPagedLog<R, D>

Source§

fn replace_log_entries(&mut self, entries: &[String]) -> Result<bool, LinkError>

Returns false when an identical committed journal needs no replacement. Pending unflushed records must be rejected before changing durable state.
Source§

fn supports_replacement(&self) -> bool

Dynamic adapters can expose the capability only when their inner log can.
Source§

impl<R: PageDevice, D: PageDevice> TransitionLogStore for CheckpointPagedLog<R, D>

Source§

fn supports_durable_flush(&self) -> bool

Whether flush requests persistent storage. Custom/volatile logs default to false; this describes an adapter, not the reliability of its hardware.
Source§

fn append_log_entry(&mut self, entry: &str) -> Result<(), LinkError>

Appends one entry. Entries never contain newlines.
Source§

fn read_log_entries(&mut self) -> Result<Vec<String>, LinkError>

Reads every entry back, oldest first.
Source§

fn flush_log(&mut self) -> Result<(), LinkError>

Makes every appended entry durable.
Source§

fn supports_compaction(&self) -> bool

Whether compact_log_entries can rewrite the durable journal. Retention uses it to bound the journal on disk; logs without it keep every entry, as before.
Source§

fn compact_log_entries(&mut self, entries: &[String]) -> Result<(), LinkError>

Atomically and durably replaces every entry with entries, the retained journal. After a crash the log holds either the old or the new journal, never a mixture. Called only between transactions and only when supports_compaction is true.

Auto Trait Implementations§

§

impl<R, D> Freeze for CheckpointPagedLog<R, D>
where R: Freeze, D: Freeze,

§

impl<R, D> RefUnwindSafe for CheckpointPagedLog<R, D>

§

impl<R, D> Send for CheckpointPagedLog<R, D>
where R: Send, D: Send,

§

impl<R, D> Sync for CheckpointPagedLog<R, D>
where R: Sync, D: Sync,

§

impl<R, D> Unpin for CheckpointPagedLog<R, D>
where R: Unpin, D: Unpin,

§

impl<R, D> UnsafeUnpin for CheckpointPagedLog<R, D>
where R: UnsafeUnpin, D: UnsafeUnpin,

§

impl<R, D> UnwindSafe for CheckpointPagedLog<R, D>
where R: UnwindSafe, D: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.