Skip to main content

Recovered

Struct Recovered 

Source
pub struct Recovered {
    pub view: HashMap<PageId, Page>,
    pub header: Option<Page>,
    pub next_lsn: Lsn,
    pub salt: u32,
    pub committed_frames: u64,
    pub end_offset: u64,
}
Expand description

Result of walking an on-disk WAL during recovery.

view is the per-page-id last-committed payload, ready to be merged into the pager’s in-memory view. next_lsn and end_offset are the seekpoints the resulting Wal uses for subsequent appends; salt and committed_frames carry over from the WAL header.

header (M6 #51) carries the page-0 file-header bytes from the most-recent committed frame whose page_id was 0. The pager applies these on adoption so the in-memory header reflects WAL-staged catalog-root updates that the on-disk header at offset 0 does not yet carry (until checkpoint).

Fields§

§view: HashMap<PageId, Page>

Per-page-id, the body of the most-recent committed frame.

§header: Option<Page>

Header page-0 bytes recovered from a WAL frame with page_id = 0, if any.

§next_lsn: Lsn

LSN that the next WalTxn::commit will assign.

§salt: u32

WAL generation salt (as read from the WAL header on disk).

§committed_frames: u64

Number of committed frames on disk (torn-tail not counted).

§end_offset: u64

Byte length where the next frame will be appended. Equals the position just past the last committed frame; torn tail (if any) sits between this offset and the file length on disk.

Implementations§

Source§

impl Recovered

Source

pub fn into_view(self) -> HashMap<PageId, Page>

Consume the Recovered and return ownership of the per- page recovered view. Used by the pager when it adopts the recovered state.

Trait Implementations§

Source§

impl Debug for Recovered

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> 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, 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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V