Skip to main content

Backing

Trait Backing 

Source
pub trait Backing<E: Context>: Mutable {
    type Config: Clone + Send + Sync;
    type Recovery: BackingRecovery<Journal = Self>;

    // Required methods
    fn recover(
        context: E,
        cfg: Self::Config,
        max_size: Option<u64>,
    ) -> impl Future<Output = Result<Self::Recovery, JournalError>> + Send;
    fn clear(
        context: E,
        cfg: Self::Config,
        size: u64,
    ) -> impl Future<Output = Result<Self::Recovery, JournalError>> + Send;
    fn span(
        context: E,
        cfg: &Self::Config,
    ) -> impl Future<Output = Result<Range<u64>, JournalError>> + Send;
}
Expand description

A Mutable journal that can back an authenticated Journal.

Required Associated Types§

Source

type Config: Clone + Send + Sync

The configuration needed to initialize this journal.

Source

type Recovery: BackingRecovery<Journal = Self>

Initialization-owned storage used to select and validate the retained prefix.

Required Methods§

Source

fn recover( context: E, cfg: Self::Config, max_size: Option<u64>, ) -> impl Future<Output = Result<Self::Recovery, JournalError>> + Send

Open recovery storage for an optional exclusive item end. Implementations may inspect later storage to validate recovery boundaries. Returns JournalError::ItemPruned when max_size lies below the retained start.

Source

fn clear( context: E, cfg: Self::Config, size: u64, ) -> impl Future<Output = Result<Self::Recovery, JournalError>> + Send

Open recovery storage reset to an empty journal at size, discarding stored items without reading them. Returns JournalError::SizeOverflow for u64::MAX.

Source

fn span( context: E, cfg: &Self::Config, ) -> impl Future<Output = Result<Range<u64>, JournalError>> + Send

Positions stored items may occupy, determined without reading them.

The start is the retained start and the end bounds every stored item. A pending reset yields an empty span at its target.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<E: Context, A: CodecFixedShared> Backing<E> for commonware_storage::journal::contiguous::fixed::Journal<E, A>

Available on neither commonware_stability_BETA nor commonware_stability_DELTA nor commonware_stability_EPSILON nor commonware_stability_GAMMA nor commonware_stability_RESERVED.
Source§

impl<E: Context, V: CodecShared> Backing<E> for commonware_storage::journal::contiguous::variable::Journal<E, V>

Available on neither commonware_stability_BETA nor commonware_stability_DELTA nor commonware_stability_EPSILON nor commonware_stability_GAMMA nor commonware_stability_RESERVED.