#[non_exhaustive]pub enum RecoveryPolicy {
StopAtFirstError,
SkipBadRecords,
}Expand description
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
StopAtFirstError
Stop at the first damaged record: yield it as a single
WalError::Corruption, then end.
The default, and the right choice for an append-only log, where a damaged record means everything after it is untrustworthy.
SkipBadRecords
Skip past a damaged record and keep going, for forensic or partial recovery.
Each damaged record is still yielded as a
WalError::Corruption — the loss is never
silent — but iteration then resumes at the next record. This is only
possible while a damaged record’s length prefix is intact enough to locate
the next one; a record whose length itself is unreadable (a short read, or
a length past the maximum) still stops iteration, because there is no way
to know where the following record begins.
Trait Implementations§
Source§impl Clone for RecoveryPolicy
impl Clone for RecoveryPolicy
Source§fn clone(&self) -> RecoveryPolicy
fn clone(&self) -> RecoveryPolicy
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for RecoveryPolicy
Source§impl Debug for RecoveryPolicy
impl Debug for RecoveryPolicy
impl Eq for RecoveryPolicy
Source§impl PartialEq for RecoveryPolicy
impl PartialEq for RecoveryPolicy
Source§fn eq(&self, other: &RecoveryPolicy) -> bool
fn eq(&self, other: &RecoveryPolicy) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for RecoveryPolicy
Auto Trait Implementations§
impl Freeze for RecoveryPolicy
impl RefUnwindSafe for RecoveryPolicy
impl Send for RecoveryPolicy
impl Sync for RecoveryPolicy
impl Unpin for RecoveryPolicy
impl UnsafeUnpin for RecoveryPolicy
impl UnwindSafe for RecoveryPolicy
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more