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
impl IndexLedger
Sourcepub fn init(
ledger_page: Page,
indexes: &[IndexDef],
mm: &mut impl MemoryAccess,
) -> MemoryResult<()>
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.
Sourcepub fn load(page: Page, mm: &mut impl MemoryAccess) -> MemoryResult<Self>
pub fn load(page: Page, mm: &mut impl MemoryAccess) -> MemoryResult<Self>
Load the page ledger from memory at the given Page.
Sourcepub fn insert<K>(
&mut self,
columns: &[&str],
key: K,
pointer: RecordAddress,
mm: &mut impl MemoryAccess,
) -> MemoryResult<()>
pub fn insert<K>( &mut self, columns: &[&str], key: K, pointer: RecordAddress, mm: &mut impl MemoryAccess, ) -> MemoryResult<()>
Inserts a key-pointer pair into the index identified by columns.
Sourcepub fn search<K>(
&self,
columns: &[&str],
key: &K,
mm: &mut impl MemoryAccess,
) -> MemoryResult<Vec<RecordAddress>>
pub fn search<K>( &self, columns: &[&str], key: &K, mm: &mut impl MemoryAccess, ) -> MemoryResult<Vec<RecordAddress>>
Looks up all pointers matching key in the index identified by columns.
Sourcepub fn delete<K>(
&mut self,
columns: &[&str],
key: &K,
pointer: RecordAddress,
mm: &mut impl MemoryAccess,
) -> MemoryResult<()>
pub fn delete<K>( &mut self, columns: &[&str], key: &K, pointer: RecordAddress, mm: &mut impl MemoryAccess, ) -> MemoryResult<()>
Deletes a specific key-pointer pair from the index identified by columns.
Sourcepub fn update<K>(
&mut self,
columns: &[&str],
key: &K,
old_pointer: RecordAddress,
new_pointer: RecordAddress,
mm: &mut impl MemoryAccess,
) -> MemoryResult<()>
pub fn update<K>( &mut self, columns: &[&str], key: &K, old_pointer: RecordAddress, new_pointer: RecordAddress, mm: &mut impl MemoryAccess, ) -> MemoryResult<()>
Updates a specific key-pointer pair in the index identified by columns.
Sourcepub fn range_scan<K>(
&self,
columns: &[&str],
start_key: &K,
end_key: Option<&K>,
mm: &mut impl MemoryAccess,
) -> MemoryResult<IndexTreeWalker<K>>
pub fn range_scan<K>( &self, columns: &[&str], start_key: &K, end_key: Option<&K>, mm: &mut impl MemoryAccess, ) -> MemoryResult<IndexTreeWalker<K>>
Opens a forward range scan on the index identified by columns.
Auto Trait Implementations§
impl Freeze for IndexLedger
impl RefUnwindSafe for IndexLedger
impl Send for IndexLedger
impl Sync for IndexLedger
impl Unpin for IndexLedger
impl UnsafeUnpin for IndexLedger
impl UnwindSafe for IndexLedger
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more