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;
}Required Associated Types§
Sourcetype Recovery: BackingRecovery<Journal = Self>
type Recovery: BackingRecovery<Journal = Self>
Initialization-owned storage used to select and validate the retained prefix.
Required Methods§
Sourcefn recover(
context: E,
cfg: Self::Config,
max_size: Option<u64>,
) -> impl Future<Output = Result<Self::Recovery, JournalError>> + Send
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.
Sourcefn clear(
context: E,
cfg: Self::Config,
size: 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
Open recovery storage reset to an empty journal at size, discarding stored items
without reading them. Returns JournalError::SizeOverflow for u64::MAX.
Sourcefn span(
context: E,
cfg: &Self::Config,
) -> impl Future<Output = Result<Range<u64>, JournalError>> + Send
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.
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.