pub enum TailStatus {
Clean,
OrphanTail {
bytes: u64,
},
Corrupt {
bytes: u64,
first_decode_error: DecodeError,
},
}Expand description
Classification of the trailing bytes past the last decodable record, if any.
Classification is by decoder behavior, not by checkpoint-commit
boundary: verify walks the byte stream and inspects the error (if
any) that stopped the walk. A partially-written record whose header
fits but whose body is truncated is OrphanTail; any structural
violation (unknown opcode, reserved sentinel, body underflow after
a valid length) is Corrupt. Higher layers combine this with
checkpoint state to decide recovery strategy.
Variants§
Clean
The log decoded cleanly from start to end; no trailing bytes.
OrphanTail
Trailing bytes exist and the decoder stopped on a Truncated
error — consistent with a crashed-mid-write tail that
write-protocol.md § 10 expects to be truncated on next open.
Corrupt
Trailing bytes exist and the decoder stopped on a non- truncation error (unknown opcode, body underflow, reserved sentinel, etc.) — genuine corruption, not the recoverable append-was-interrupted pattern.
Fields
first_decode_error: DecodeErrorThe DecodeError that stopped the walk.
Implementations§
Source§impl TailStatus
impl TailStatus
Sourcepub const fn is_corrupt(&self) -> bool
pub const fn is_corrupt(&self) -> bool
true if the tail indicates genuine corruption rather than a
recoverable truncated write.
Sourcepub const fn trailing_bytes(&self) -> u64
pub const fn trailing_bytes(&self) -> u64
Number of trailing bytes (zero for Clean).
Trait Implementations§
Source§impl Clone for TailStatus
impl Clone for TailStatus
Source§fn clone(&self) -> TailStatus
fn clone(&self) -> TailStatus
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TailStatus
impl Debug for TailStatus
Source§impl PartialEq for TailStatus
impl PartialEq for TailStatus
impl Eq for TailStatus
impl StructuralPartialEq for TailStatus
Auto Trait Implementations§
impl Freeze for TailStatus
impl RefUnwindSafe for TailStatus
impl Send for TailStatus
impl Sync for TailStatus
impl Unpin for TailStatus
impl UnsafeUnpin for TailStatus
impl UnwindSafe for TailStatus
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.