Skip to main content

IndexLedger

Struct IndexLedger 

Source
pub struct IndexLedger { /* private fields */ }
Expand description

The IndexLedger struct is responsible for managing and providing access to the indexes in the database.

Implementations§

Source§

impl IndexLedger

Source

pub fn init( ledger_page: Page, indexes: &[IndexDef], mm: &mut impl MemoryAccess, ) -> MemoryResult<()>

Initializes the index ledger by creating an empty ledger page in memory and setting up the initial structure.

Source

pub fn load(page: Page, mm: &mut impl MemoryAccess) -> MemoryResult<Self>

Load the page ledger from memory at the given Page.

Source

pub fn insert<K>( &mut self, columns: &[&str], key: K, pointer: RecordAddress, mm: &mut impl MemoryAccess, ) -> MemoryResult<()>
where K: Encode + Ord,

Inserts a key-pointer pair into the index identified by columns.

Source

pub fn search<K>( &self, columns: &[&str], key: &K, mm: &mut impl MemoryAccess, ) -> MemoryResult<Vec<RecordAddress>>
where K: Encode + Ord,

Looks up all pointers matching key in the index identified by columns.

Source

pub fn delete<K>( &mut self, columns: &[&str], key: &K, pointer: RecordAddress, mm: &mut impl MemoryAccess, ) -> MemoryResult<()>
where K: Encode + Ord,

Deletes a specific key-pointer pair from the index identified by columns.

Source

pub fn update<K>( &mut self, columns: &[&str], key: &K, old_pointer: RecordAddress, new_pointer: RecordAddress, mm: &mut impl MemoryAccess, ) -> MemoryResult<()>
where K: Encode + Ord,

Updates a specific key-pointer pair in the index identified by columns.

Source

pub fn range_scan<K>( &self, columns: &[&str], start_key: &K, end_key: Option<&K>, mm: &mut impl MemoryAccess, ) -> MemoryResult<IndexTreeWalker<K>>
where K: Encode + Ord,

Opens a forward range scan on the index identified by columns.

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.