pub enum Pointer<Index, ReducedIndex> {
    OnDisk(u64),
    Loaded {
        previous_location: Option<u64>,
        entry: Box<BTreeEntry<Index, ReducedIndex>>,
    },
}
Expand description

A pointer to a location on-disk. May also contain the node already loaded.

Variants

OnDisk(u64)

The position on-disk of the node.

Loaded

Fields

previous_location: Option<u64>

The position on-disk of the node, if it was previously saved.

entry: Box<BTreeEntry<Index, ReducedIndex>>

The loaded B-Tree entry.

An in-memory node that may have previously been saved on-disk.

Implementations

Attempts to load the node from disk. If the node is already loaded, this function does nothing.

Returns the previously-load()ed entry.

Returns the previously-load()ed entry as a mutable reference.

Returns the position on-disk of the node being pointed at, if the node has been saved before.

source

pub fn map_loaded_entry<Output, CallerError: Display + Debug, Cb: FnOnce(&BTreeEntry<Index, ReducedIndex>, &mut dyn File) -> Result<Output, AbortError<CallerError>>>(
    &self,
    file: &mut dyn File,
    vault: Option<&dyn AnyVault>,
    cache: Option<&ChunkCache>,
    current_order: Option<usize>,
    callback: Cb
) -> Result<Output, AbortError<CallerError>>

Loads the pointed at node, if necessary, and invokes callback with the loaded node. This is useful in situations where the node isn’t needed to be accessed mutably.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

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

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more