PersistableContiguous

Trait PersistableContiguous 

Source
pub trait PersistableContiguous: MutableContiguous {
    // Required methods
    fn commit(&mut self) -> impl Future<Output = Result<(), Error>>;
    fn sync(&mut self) -> impl Future<Output = Result<(), Error>>;
    fn close(self) -> impl Future<Output = Result<(), Error>>;
    fn destroy(self) -> impl Future<Output = Result<(), Error>>;
}

Required Methods§

Source

fn commit(&mut self) -> impl Future<Output = Result<(), Error>>

Durably persist the journal but does not write all data, potentially leaving recovery required on startup.

For a stronger guarantee that eliminates potential recovery, use Self::sync instead.

Source

fn sync(&mut self) -> impl Future<Output = Result<(), Error>>

Durably persist the journal and write all data, guaranteeing no recovery will be required on startup.

This provides a stronger guarantee than Self::commit but may be slower.

Source

fn close(self) -> impl Future<Output = Result<(), Error>>

Close the journal, syncing all pending writes and releasing resources.

Source

fn destroy(self) -> impl Future<Output = Result<(), Error>>

Destroy the journal, removing all associated storage.

This method consumes the journal and deletes all persisted data including blobs, metadata, and any other storage artifacts. Use this for cleanup in tests or when permanently removing a journal.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<E, C, H> PersistableContiguous for commonware_storage::journal::authenticated::Journal<E, C, H, Clean<H::Digest>>

Source§

impl<E: Storage + Metrics, A: CodecFixed<Cfg = ()>> PersistableContiguous for commonware_storage::journal::contiguous::fixed::Journal<E, A>

Source§

impl<E: Storage + Metrics, V: Codec> PersistableContiguous for commonware_storage::journal::contiguous::variable::Journal<E, V>