Skip to main content

ChainReport

Struct ChainReport 

Source
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: u64

Records 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: u64

Bytes 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

Source

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.

Source

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

Source§

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)

Performs copy-assignment from source. Read more
Source§

impl Debug for ChainReport

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.