pub struct ChainReport {
pub intact_records: u64,
pub fault: Option<Fault>,
pub torn_tail_bytes: u64,
pub head: Option<ContentHash>,
}Expand description
What a read-only walk of the log found.
Fields§
§intact_records: u64Records that decoded and linked correctly, counted from the start until the first fault (or to the end, if there was none).
fault: Option<Fault>The first thing wrong, if anything was.
torn_tail_bytes: u64Bytes of unterminated final record, or 0 if the file ends on a
record boundary. Non-zero is repairable; see truncate_tail.
head: Option<ContentHash>Hash of the last intact record, which is what a restore has to agree with.
Implementations§
Source§impl ChainReport
impl ChainReport
Sourcepub fn is_usable(&self) -> bool
pub fn is_usable(&self) -> bool
Whether the log can be opened and used as it stands.
A torn tail does not make this false: crate::FileLog::open repairs
that on its own, and the bytes it discards were never
acknowledged.
Sourcepub fn is_repairable(&self) -> bool
pub fn is_repairable(&self) -> bool
Whether the only thing wrong is a tail that was still being
written, which truncate_tail can repair.
Trait Implementations§
Source§impl Clone for ChainReport
impl Clone for ChainReport
Source§fn clone(&self) -> ChainReport
fn clone(&self) -> ChainReport
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 moreAuto Trait Implementations§
impl Freeze for ChainReport
impl RefUnwindSafe for ChainReport
impl Send for ChainReport
impl Sync for ChainReport
impl Unpin for ChainReport
impl UnsafeUnpin for ChainReport
impl UnwindSafe for ChainReport
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