Skip to main content

MountMode

Enum MountMode 

Source
pub enum MountMode {
    Full,
    Verify,
    HeadersOnly,
}
Expand description

How much of the log to index when mounting.

Variants§

§

Full

Rebuild the full index — entry counts, timestamp ranges and bloom filters — reading each sealed sector’s SectorFooter where one is present and valid, and scanning the sector body only where it is not.

Required for reads, and the default. Cost is one page read per sealed sector, so it is proportional to the sector count on a log this build wrote. It falls back to a body scan — proportional to the data stored — for the sector a crashed run left active, and for any sector whose footer is missing or fails to validate.

Because a footer records what was written rather than what is still readable, this mode does not re-verify sealed entries and therefore reports no corrupt_entries for the sectors it took from a footer. Reads are unaffected: every entry a query returns is CRC-checked when it is read. Use Verify to check the whole medium at mount instead.

§

Verify

Scan every entry of every valid sector, ignoring footers.

Identical to Full in what it produces, and the only mode that re-verifies stored data at mount: the index is built from entries whose CRCs pass now, and corrupt_entries counts the rest. Cost is proportional to the data stored, so a large nearly-full medium can take seconds on a slow bus.

This is what Full did before sectors carried footers.

§

HeadersOnly

Read sector headers only, plus a full scan of the single highest-sequence sector so appends can resume at the right offset.

Bloom filters, per-sector entry counts and timestamp ranges are not rebuilt, so latest, oldest, count and query_range return Error::ReadsUnavailable. Streaming via read_from still works.

Now that sealed sectors carry footers, Full costs one page read per sector where this costs one header read, so the gap is small on a log this build wrote. What HeadersOnly still guarantees is that the cost is O(sector_count) unconditionally — it never falls back to a body scan, whatever state the medium is in. That is the reason to keep reaching for it on a write-only replica read elsewhere.

Trait Implementations§

Source§

impl Clone for MountMode

Source§

fn clone(&self) -> Self

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 Copy for MountMode

Source§

impl Debug for MountMode

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for MountMode

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for MountMode

Source§

impl Format for MountMode

Available on crate feature defmt only.
Source§

fn format(&self, f: Formatter<'_>)

Writes the defmt representation of self to fmt.
Source§

impl PartialEq for MountMode

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for MountMode

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.