pub trait BackingRecovery:
Send
+ Sync
+ Sized {
type Journal: Mutable;
// Required methods
fn bounds(&self) -> Range<u64> ⓘ;
fn read(
&self,
position: u64,
) -> impl Future<Output = Result<<Self::Journal as Contiguous>::Item, JournalError>> + Send;
fn reset(
self,
size: u64,
) -> impl Future<Output = Result<Self, JournalError>> + Send;
fn finish(
self,
size: u64,
) -> impl Future<Output = Result<Self::Journal, JournalError>> + Send;
// Provided method
fn last_matching<P>(
&self,
ceiling: u64,
predicate: P,
) -> impl Future<Output = Result<u64, JournalError>> + Send
where P: FnMut(&<Self::Journal as Contiguous>::Item) -> bool + Send { ... }
}Expand description
A journal under initialization, with read access before its retained end is finalized.
Finishing consumes this owner. A live journal cannot regain recovery access. Opening may repair torn storage, but selecting a prefix does not itself discard journal history.
Required Associated Types§
Required Methods§
Sourcefn bounds(&self) -> Range<u64> ⓘ
fn bounds(&self) -> Range<u64> ⓘ
Available item positions, including the retained pruning boundary.
Sourcefn read(
&self,
position: u64,
) -> impl Future<Output = Result<<Self::Journal as Contiguous>::Item, JournalError>> + Send
fn read( &self, position: u64, ) -> impl Future<Output = Result<<Self::Journal as Contiguous>::Item, JournalError>> + Send
Read a retained item for initialization validation.
Provided Methods§
Sourcefn last_matching<P>(
&self,
ceiling: u64,
predicate: P,
) -> impl Future<Output = Result<u64, JournalError>> + Send
fn last_matching<P>( &self, ceiling: u64, predicate: P, ) -> impl Future<Output = Result<u64, JournalError>> + Send
Select the latest retained item satisfying predicate below an exclusive ceiling.
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> BackingRecovery for commonware_storage::journal::contiguous::fixed::Recovery<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> BackingRecovery for commonware_storage::journal::contiguous::fixed::Recovery<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> BackingRecovery for commonware_storage::journal::contiguous::variable::Recovery<E, V>
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, V: CodecShared> BackingRecovery for commonware_storage::journal::contiguous::variable::Recovery<E, V>
Available on neither
commonware_stability_BETA nor commonware_stability_DELTA nor commonware_stability_EPSILON nor commonware_stability_GAMMA nor commonware_stability_RESERVED.